1、去掉重覆數據DISTINCT SELECT DISTINCT 去掉重覆數據列 FROM TestE WHERE pn='SPLW' 2、取最新數據 select * FROM TestE WHERE items = (select max(items) from TestE s where s. ...
1、去掉重覆數據DISTINCT
SELECT DISTINCT 去掉重覆數據列 FROM TestE WHERE pn='SPLW'
2、取最新數據
select * FROM TestE WHERE items = (select max(items) from TestE s where s.LotNumber=TestE.LotNumber AND s.pn='SPLW');
(LotNumber:去掉重覆數據列;items:唯一標識;pn:查找條件)