File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes A query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "A query" Watch "A query" New topic
Author

A query

Jimmy Lopez
Greenhorn

Joined: Mar 24, 2006
Posts: 9
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

Joined: Jul 08, 2004
Posts: 531

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 ]

Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Jimmy Lopez
Greenhorn

Joined: Mar 24, 2006
Posts: 9
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
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A query