MULTI DELETE中的未知表 [英] Unknown table in MULTI DELETE
本文介绍了MULTI DELETE中的未知表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此查询使我在MySQL 5.1.57中出错,但在5.1.53中有效:
This query gives me an error in MySQL 5.1.57, works in 5.1.53 though:
DELETE f
FROM table1 AS f
JOIN table2 AS dsy
JOIN table3 AS ds
JOIN table4 AS dp
JOIN table5 AS dg
WHERE
dsy.f1 = f.f1
AND ds.f2 = f.f2
AND dp.f3 = f.f3
AND dg.f4 = f.f4
AND dsy.school_year = 2011
AND ds.id = 29620
AND dp.id = 14120
AND dg.grade_level = 5;
错误是:MULTI DELETE中的未知表'f'
The error is: Unknown table 'f' in MULTI DELETE
谢谢!
实际上,该查询有效,问题是我使用模式名称声明了诸如schema.table1之类的表(我将其删除以在此处发布更清晰的查询),并且该模式名称会中断...
Actually this query works, the thing is I was using the schema name to declare my tables like schema.table1 (I removed it to post a more clear query here), with the schema name it breaks...
推荐答案
尝试此查询-
DELETE f
FROM table1 AS f
JOIN table2 AS dsy
ON dsy.f1 = f.f1
JOIN table3 AS ds
ON ds.f2 = f.f2
JOIN table4 AS dp
ON dp.f3 = f.f3
JOIN table5 AS dg
ON dg.f4 = f.f4
WHERE
dsy.school_year = 2011 AND ds.id = 29620 AND dp.id = 14120 AND dg.grade_level = 5;
这篇关于MULTI DELETE中的未知表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文