------解决方案--------------------
delete * from PartTwo t where exists(select 1 from PartOne where t.GUID=GUID and Time<'2012-08-20')
------解决方案-------------------- 这题100分太赚了。
------解决方案-------------------- 试试这个:
SQL code
select GUIDTwo, Name, Age
from PartTwo
left outer join PartOne on PartOne.GuidOne = PartTwo.GuidTwo
and PartOne.Time < '2012-08-20'
where PartOne.GuidOne is null
------解决方案--------------------
SQL code
DELETE p
FROM PartTwo AS p
WHERE EXISTS ( SELECT 1
FROM PartOne
WHERE GUID = p.GUID AND Time < '2012-08-20' )
------解决方案--------------------
SQL code
delete from PartTow
left outer join PartOne on PartOne.Guid = PartTow.GuidTwo
where Guid is null
------解决方案--------------------
------解决方案--------------------
SQL code
delete * from PartTwo t
where exists(select 1 from PartOne where t.GUID=GUID and Time<'2012-08-20')