delete from Table1
where (id,positionid)in (select (id,positionid) from Table1 a
left join Table2 b on
a.positionid=b.positionid where ID ='03CS391' and b.NeverUpdateBOM='N')我要删除table1里的某些资料,但是对于table1的资料还要进行筛选。
执行时会出现“接近 ',' 之處的語法不正確。”的错误提醒。
请问应该如何写??
急!!
where (id,positionid)in (select (id,positionid) from Table1 a
left join Table2 b on
a.positionid=b.positionid where ID ='03CS391' and b.NeverUpdateBOM='N')我要删除table1里的某些资料,但是对于table1的资料还要进行筛选。
执行时会出现“接近 ',' 之處的語法不正確。”的错误提醒。
请问应该如何写??
急!!
a.positionid=b.positionid where ID ='03CS391' and b.NeverUpdateBOM='N') and
positionid in (select positionid from Table1 a left join Table2 b on
a.positionid=b.positionid where ID ='03CS391' and b.NeverUpdateBOM='N')
delete from Table1 where exists
select 1 from (
select a.id,a.positionid from Table1 a left join Table2 b on
a.positionid=b.positionid where ID ='03CS391' and b.NeverUpdateBOM='N'
)a where id=a.id and positionid=a.positionid