日期:2014-05-17  浏览次数:20787 次

pl/sql问题
一张dept表怎么取前五个?

------解决方案--------------------
rownum <=5
------解决方案--------------------
需要按照某条件排序不?

不需要,则:
select * from dept where rownum<=5;

需要,则:
select * from (select select t.*, ROWNUM rn from dept order by xxx asc|desc)
where rn<=5
------解决方案--------------------
select * from dept where rowid<6
------解决方案--------------------
SQL code
select * from dept where rownum <=5;

------解决方案--------------------
探讨

需要,则:
select * from (select select t.*, ROWNUM rn from dept order by xxx asc|desc)
where rn <=5