Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to order it in descending order

455054May 24 2007 — edited May 24 2007

I have this sql statement and I would like the out put to be in descending order but for some reason it is not the case. this is what the out put looks like

12/31/2006
12/31/2005
12/15/2006
11/18/2005
05/18/2007
04/27/2007

but i want the out put to look like this
05/18/2007
04/27/2007
12/31/2006
12/15/2006
12/31/2005
11/18/2005


 select distinct trim(to_char(b.datelet ,'fmMonth ddth yyyy')) DateForLetting , to_char(b.datelet, 'MM/DD/YYYY') compDate 
 from bidlet b , letprop l 
 where datelet > to_date('12/31/2004','MM/DD/YYYY') 
 and datelet < trunc(sysdate) 
 and l.letting = b.letting 
 AND SUBSTR (l.lcontid, 4, 4) <= '5' 
 order by 2 DESC 

thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2007
Added on May 24 2007
6 comments
315 views