数据库中delete from s where SNO = 'S2' delete from spj where SNO = 'S2'出现[Err] 1064 - 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 'delete from spj where SNO = 'S2'' at line 2怎么办
时间: 2023-07-02 09:07:32 浏览: 277
数据库疑难杂症 java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual tha
这个错误是因为你在 SQL 语句中同时执行了两条语句。在 MySQL 中,一个查询只能执行一条语句。你需要将这两条语句分开执行。你可以将它们写成两条单独的 SQL 查询:
```
delete from s where SNO = 'S2';
delete from spj where SNO = 'S2';
```
这样应该就不会出现语法错误了。
阅读全文