select * from @tbMN a where not exists (
select * from ModelLossInfo where ModelName=a.ModelName
and PN=a.PartNumber and LineName=@LineName
and CONVERT(varchar(12),ScanDate,23)=convert(varchar(12),@ScanDate,23)
转载于:https://www.cnblogs.com/lgxll/archive/2012/08/29/2661966.html