怎么从表2中删除可能存在的跟表1中的名字和编号相同的记录?(在线等)。谢谢了。

解决方案 »

  1.   

    delete a from 表2 a where exists(select 1 from 表1 where 编号=a.编号and 名字=a.名字)
      

  2.   

    delete a from t2 a
    inner join t1 b
    on a.id=b.id and a.name=b.name
      

  3.   

    么从表2中删除可能存在的跟表1中的名字和编号相同的记录?(在线等)。谢谢了。delete 表2 from 表2 m where exists(select 1 from 表1 where 名字 = m.名字 and 编号 = m.编号)
    --or
    delete 表2 
    from 表2 m ,表1 n
    where m.名字 = n.名字 and m.编号 = n.编号)