delete from A where PrimaryKey in(select PrimaryKey from B)
但是我这样写为什么错: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 from A where EXISTS (select * from B WHERE A.PrimaryKey =B.PrimaryKey ) 或者 delete A from B where A.PrimaryKey =B.PrimaryKey
但是我这样写为什么错: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
给两个表建立连接: delete a from a join b on a.id=b.idor delete a where id in (select id from b )
错误信息如下:
The column prefix 'B' does not match with a table name or alias name used in the query.
或者
delete A from B where A.PrimaryKey =B.PrimaryKey
错误信息如下:
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
delete a from a join b on a.id=b.idor delete a where id in (select id from b )