关于Mysql删除语句delete相关问题

来源:互联网 发布:凸轮弹簧机编程 编辑:程序博客网 时间:2024/04/29 16:42

delete from table where...


当取别名时,有可能会报: 别名附近有错误( You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't...)

delete from table t where t.id=...

因为有别名时,等同于两个表.要指定一个表名

更正为:

delete t from table t where t.id=...

delete 后加上别名 就成功了。。。

0 0