ORACLE SQL查询表的第一条数据

-- 查询第一行
-- 不包含排序时
select * from tm_pm_pay where hospital_code = '0002' and rownum = 1
-- 包含排序时
select * from (select * from tm_pm_pay t where hospital_code = '0002' order by pay_no desc) where rownum = 1
-- 查询前10行
select * from tm_pm_pay where rownum <= 10

 

posted @ 2022-02-26 11:57  一隅桥畔  阅读(3278)  评论(0)    收藏  举报