一尘不染

subselect sql查询不适用于mysql 4

sql

以下sql查询在运行mysql 5的开发服务器上正常运行,但是当我在运行mysql
4的实时服务器上尝试运行它时,会抛出错误,有人可以帮助我了解如何调整查询以在mysql 4上运行吗?

select * FROM Properties WHERE propertyid IN (select id from todelete)

阅读 126

收藏
2021-05-16

共1个答案

一尘不染

SELECT * FROM Properties RIGHT JOIN todelete ON (Properties.propertyid = todelete.id);

要从属性中删除符合此条件的所有行,请使用以下命令:

DELETE Properties FROM Properties INNER JOIN todelete ON (Properties.propertyid = todelete.id);
2021-05-16