September 19, 2008

Display table data in reverse order


Very rarely you can get into a situation where u want to show the table data in a reverse order i.e., last row displayed first, 2nd row will be last but one and so on....

The first thing that comes into mind for such a query is user order by with desc/asc.
But watch out baby in every case you cannot use order by. Even if u use, it might not show u the desired result.So what to do????????

Here is your solution


SELECT ROWID AS temp, * FROM emp ORDER BY temp DESC;


Dont forget to check out this stmt guyzzzzz

0 comments: