select * from (select rank() over(partition by barcode order by sheetdate) num,
* from ScanRecord where scanMode=0 and workStageName='QC')t where num=1
select * from (select rank() over(partition by barcode order by sheetdate) num,
* from ScanRecord where scanMode=0 and workStageName='QC')t where num=1