Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Query sorting without Order by
It *IS* possible to get rows back in order without a sort, assuming you have an index on what you want to sort by!
Let's say you have a table called MY_TABLE, and it has an index called MY_TABLE_X. You can get the rows back in the order of the index like this :
select /*+ INDEX (MY_TABLE_X, MY_TABLE) */ * from MY_TABLE
if you want the rows in decending order, do this
select /*+ INDEX_DESC (MY_TABLE_X, MY_TABLE) */ * from MY_TABLE
--John
Sent via Deja.com
http://www.deja.com/
Received on Mon Feb 05 2001 - 12:53:21 CST