删除多行错误 [英] Delete multiple rows error

查看:52
本文介绍了删除多行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询要删除一些行,这怎么了?

I have a query to delete some rows, whats wrong with it?

DELETE FROM table1, table2, table3
WHERE table1.id = table2.id
AND table2.id = table3.id
AND table1.id = 10

请提供有关查询的帮助

推荐答案

通过此查询,它应该可以工作.

With this query it should work.

DELETE t1, t2, t3 FROM table1 t1
INNER JOIN table2 t2 ON t1.id = t2.id
INNER JOIN table3 t3 ON t2.id = t3.id
WHERE t1.id = 10

我使用以下模式在本地对其进行了测试: http://sqlfiddle.com/#!9/e5be4/9

I tested it local with this schema: http://sqlfiddle.com/#!9/e5be4/9

您可以在socd中找到详细信息: https://dev. mysql.com/doc/refman/5.0/en/delete.html

Details you can find in the socd: https://dev.mysql.com/doc/refman/5.0/en/delete.html

这篇关于删除多行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆