delete in_out_detail from in_out_detail d inner join in_out_head h on d.id = h.flag

解决方案 »

  1.   

    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 )
      

  2.   

    delete in_out_detail from in_out_detail d right join in_out_head h on d.id=h.id where h.flag=@value
      

  3.   

    delete delete in_out_detail  where id in(select id from in_out_head where flag=1)
      

  4.   

    delete in_out_detail from in_out_detail L inner join in_out_head R on L.ID = R.ID
    where R.flag=1
      

  5.   

    delete in_out_detail from in_out_detail a right join in_out_head b on a.id=b.id where b.flag=1
      

  6.   

    delete in_out_detail 
    from in_out_head h,in_out_detail d
    where h.id=d.id and h.flag=1