日期:2014-05-18 浏览次数:20829 次
select O.boardNumID from Orders as O where O.StationId=39 and o.StatusId =1; except select 0.boardNumID from Orders as O where O.StationId=39 and o.StatusId =0;
------解决方案--------------------
select O.boardNumID-( select boardNumID from Orders where StationId=39 and StatusId =0 and id=o.id)--id为唯一值 from Orders as O where O.StationId=39 and o.StatusId =1;
------解决方案--------------------
select O.boardNumID from Orders as O where O.StationId=39 and o.StatusId =1 and NOT IEXISTS(select 1 from Orders where boardNumID=O.boardNumID StationId=39 and StatusId =0)