IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get the details in descending order from the table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shekhar.sumanin

New User


Joined: 18 Dec 2006
Posts: 1
Location: hyderabad

PostPosted: Mon Dec 18, 2006 8:52 pm
Reply with quote

Without changing the verb ascending to descending how to get the details in descending order from the table
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 18, 2006 10:30 pm
Reply with quote

Other than reading all the data "Ascending" and storing it for a reversing sort or table lookup in reverse, I can't think of a way.

Why can't you change the verb?

Well you could add a column, load it with a reversed key and retrieve it with that index. Can a column be renamed? Drop the original key, rename it and new reversed key column and rebuild the original key to the backwards key, the program would never know what hit it....grin....
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Dec 21, 2006 3:36 am
Reply with quote

Well,

If you had a table declared as:

DECLARE TABLE1 TABLE
(COL1 DEC(5),
COL2 DEC(11)
)

Any you want to order by COL1 DESC, but you cannot use ?DESC? you could:

Code:

SELECT COL1,
       COL2
  FROM DB2.TABLE1
 ORDER BY (99999 ? COL1)


Dave
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Rotate partition-logical & physic... DB2 0
Search our Forums:

Back to Top