由于开发需要,
要求SQL语句能先执行排序,然后再取前五条.
我试了好几种办法,
诸如: select * from table_a where rownum < 5 order by column_a;
以及 select * from table_a where column_a in (select column_a from table_a order by column_a) and rownum < 5;都不行啊.
现在我实在是汗了.
请大家帮忙一起想想办法吧.
要求SQL语句能先执行排序,然后再取前五条.
我试了好几种办法,
诸如: select * from table_a where rownum < 5 order by column_a;
以及 select * from table_a where column_a in (select column_a from table_a order by column_a) and rownum < 5;都不行啊.
现在我实在是汗了.
请大家帮忙一起想想办法吧.
select * from table_a order by column_a)
where rownum <= 5
这个肯定行。
(select * from table_a order by column_a) aa
where rownum<5
select * from(
select * from table_a order by column_a)
where rownum <= 5
可以的,8i,9i都是可以的。