delete A
where 主键 in(select 主键 from B)

解决方案 »

  1.   

    delete from A where PrimaryKey in(select PrimaryKey from B)
      

  2.   

    但是我这样写为什么错:DELETE FROM A WHERE A.ID = B.ID
    错误信息如下:
    The column prefix 'B' does not match with a table name or alias name used in the query.
      

  3.   

    delete from A where EXISTS (select * from B WHERE A.PrimaryKey =B.PrimaryKey )
    或者
    delete A from B where A.PrimaryKey =B.PrimaryKey
      

  4.   

    但是我这样写为什么错:DELETE FROM A WHERE A.ID = B.ID
    错误信息如下:
    The column prefix 'B' does not match with a table name or alias name used in the query.
    改为 DELETE  A FROM B WHERE A.ID = B.ID
      

  5.   

    给两个表建立连接:
    delete a from a join b on a.id=b.idor delete a where id in (select id from b )