新文章 网摘 文章 随笔 日记

Oracle中Top的用法

WITH t AS (SELECT ROW_NUMBER() OVER(ORDER BY e.BatchNo) as row_number, tc.* ,e.batchno
from ROHS_TOCHECK tc
left join ROHS_MATERIALENTRY e on tc.entryId=e.id
where e.MaterialNo = '852-01033-00A'
and e.VendorCode = '198037'
and e.BatchNo >= 11) 
Select * from t where row_number<=5;

 

posted @ 2020-09-23 14:02  岭南春  阅读(1433)  评论(0)    收藏  举报