The following sql query works fine on my development server running mysql 5, but when I try it on my live server running mysql 4 it throws an error, can anyone help show me how to adapt my query to run on mysql 4?
下面的sql查询在我运行mysql 5的开发服务器上运行良好,但是当我在运行mysql 4的实时服务器上尝试它时,它会抛出一个错误,谁能帮助我演示如何调整查询以在mysql 4上运行?
select * FROM Properties WHERE propertyid IN (select id from todelete)
2 个解决方案
#1
1
SELECT * FROM Properties RIGHT JOIN todelete ON (Properties.propertyid = todelete.id);
To delete all rows from Properties which match this condition use this:
要从与此条件相匹配的属性中删除所有行,请使用以下方法:
DELETE Properties FROM Properties INNER JOIN todelete ON (Properties.propertyid = todelete.id);
See T-SQL: Selecting rows to delete via joins
参见T-SQL:通过连接选择要删除的行
#2
3
Subqueries are not supported in versions lower than Mysql 4.1.
在Mysql 4.1以下的版本中不支持子查询。
http://dev.mysql.com/doc/refman/4.1/en/subqueries.html
http://dev.mysql.com/doc/refman/4.1/en/subqueries.html
#1
1
SELECT * FROM Properties RIGHT JOIN todelete ON (Properties.propertyid = todelete.id);
To delete all rows from Properties which match this condition use this:
要从与此条件相匹配的属性中删除所有行,请使用以下方法:
DELETE Properties FROM Properties INNER JOIN todelete ON (Properties.propertyid = todelete.id);
See T-SQL: Selecting rows to delete via joins
参见T-SQL:通过连接选择要删除的行
#2
3
Subqueries are not supported in versions lower than Mysql 4.1.
在Mysql 4.1以下的版本中不支持子查询。
http://dev.mysql.com/doc/refman/4.1/en/subqueries.html
http://dev.mysql.com/doc/refman/4.1/en/subqueries.html