Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A query

 
Jimmy Lopez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CODE DECODE_ONE
100010:00 //noticed in database looks like this but I am trying to
6006:00 //make the top line go to the last in my query ???
6156:15 // My query is: select code, decode_one
6306:30 // from rts_code_dtl
6456:45 // where category_cd = 34
7007:00
7157:15
7307:30
7457:45
8008:00
8158:15
8308:30
8458:45
9009:00
9159:15
9309:30
9459:45
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not exactly understand what you need,
but if you want to sort them opposit of what it looks like then you should reorder them.
So select the records based on code field in descending order.

[ March 29, 2006: Message edited by: Masoud Kalali ]
 
Jimmy Lopez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code does is not doing what I want it to do, the numbers you see below they are A.M. Times. It supposed to begin from 6 to 10. How can I take the ten and put it at the end.


CODE DECODE_ONE
1000 10:00 //noticed in database looks like this but I am trying to
600 6:00 //make the top line go to the last in my query ???
615 6:15 // My query is: select code, decode_one
630 6:30 // from rts_code_dtl
645 6:45 // where category_cd = 34
700 7:00
715 7:15
730 7:30
745 7:45
800 8:00
815 8:15
830 8:30
845 8:45
900 9:00
915 9:15
930 9:30
945 9:45
[ March 29, 2006: Message edited by: Jimmy Lopez ]
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks to me like "... ORDER BY code" should sort them in the way you want. Unless the CODE column is a text type. But since it looks like it was put there to act as an index to the DECODE_ONE column, which is a text type, surely CODE would be defined as a numeric type.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic