从MySQL中的连接视图表中删除行

时间:2013-09-20 16:56:38

标签: mysql

我在表格中有45K行(125k中)我需要删除。

 DELETE FROM `tablename` WHERE `name` IS NULL ;

返回

ERROR 1395 (HY000): Can not delete from join view

2 个答案:

答案 0 :(得分:1)

执行SHOW CREATE VIEW tablename以查看哪些表位于联接视图的select中。结果将是:

CREATE VIEW tablename AS SELECT name, f2, f3 … FROM table1;

当您拥有名为nametable1)列的表名时,您可以执行删除操作:

DELETE FROM `table1` WHERE `name` IS NULL ;

答案 1 :(得分:0)

试试这个

DELETE FROM `tablename` WHERE `name`="" ;