delete from in_out_detail dt where exists( Select 1 from in_out_Head where id=dt.id and flag=1 ) 或 delete from in_out_detail dt where id in( Select id from in_out_Head where flag=1 )
delete in_out_detail from in_out_detail d right join in_out_head h on d.id=h.id where h.flag=@value
delete delete in_out_detail where id in(select id from in_out_head where flag=1)
delete in_out_detail from in_out_detail L inner join in_out_head R on L.ID = R.ID where R.flag=1
delete in_out_detail from in_out_detail a right join in_out_head b on a.id=b.id where b.flag=1
delete in_out_detail from in_out_head h,in_out_detail d where h.id=d.id and h.flag=1
where exists( Select 1 from in_out_Head where
id=dt.id and flag=1 )
或
delete from in_out_detail dt
where id in( Select id from in_out_Head where
flag=1 )
where R.flag=1
from in_out_head h,in_out_detail d
where h.id=d.id and h.flag=1