October 23rd, 2003, 05:31 PM
Hi,I have a little problem and i dont know how to solve it.
I have a query that returns a list of names that are always the same ones,for example:
My problem is that i want to order this result just like i wrote it,so i can't use order by that column. Anyone know a way to that?
October 23rd, 2003, 05:49 PM
Please have a look at the rownum function as in:
select rownum, owner, table_name from all_tables
October 23rd, 2003, 06:01 PM
You might be better off by looking at the address of each row.
1) select rowid from your_table;
2) select rowidtochar(rowid) from your_table;
3) select rowidtochar(rowid) from your_table order by rowidtochar(rowid);
October 24th, 2003, 03:54 AM
If you have a version that does not support case expressions, you can use the decode function.
when 'Literature' then 1
when 'Mathematics' then 2
when 'Science' then 3
when 'Chemistry' then 4 end