-- 查询第一行 -- 不包含排序时 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;