【mysql数据库】MySql delete语句使用表别名报错

SQL删除语句添加表别名:DELETE FROM table_name t WHERE t.id=1;报错了。

Error : 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 where t.id=1' at line 1

原因,删除语句时要么不使用表别名,要么在DELETE后面添加上表别名。

格式:delete <alias> from <table> <alias> where <alias>.<field>...

posted @ 2020-01-01 20:25  海底一小鱼  阅读(625)  评论(0编辑  收藏  举报