mysql在进行delete操作时,对表使用别名,需要注意别名出现的位置。
以下sql执行时,会报错
delete from category c where c.id =3
错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version
for the right syntax to use near 'c where c.id =3' at line 1
正确语法:
delete <alias> from <table> <alias> where <alias>.<field>...
例如以下:
delete c from category c where c.id =3
共 0 行受到影响