select rank() over

select * from (select rank() over(partition by barcode order by sheetdate) num,

* from ScanRecord where scanMode=0 and workStageName='QC')t where num=1

原文地址:https://www.cnblogs.com/leavind/p/3415393.html