mysql語法問題,我使用的mysql是8.0.11
check the manual that corresponds to your MySQL server version for the right syntax to use near 'where item_id = 5 and stock >= 1' at line 3.
check the manual that corresponds to your MySQL server version for the right syntax to use near 'where item_id = 5 and stock >= 1' at line 3.
2019-03-25
舉報(bào)
2020-03-19
在銷量增加中犯了同樣的錯(cuò)誤,一開始就認(rèn)為是sql語句錯(cuò)了,結(jié)果就是這個(gè)逗號(hào)被直接忽略,在service層浪費(fèi)了兩個(gè)半鐘。。。感謝啊,要是沒你的提示還不知道要搞多久。
2019-03-25
解決了,原來是沒有刪除
這的逗號(hào)
2019-03-25
### Error updating database.? Cause: java.sql.SQLSyntaxErrorException: 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 'where item_id = 5 and stock >= 1' at line 3
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: update item_stock? ? ?set stock = stock - 1,? ? ?where item_id = 5 and stock >= 1
### Cause: java.sql.SQLSyntaxErrorException: 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 'where item_id = 5 and stock >= 1' at line 3
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 'where item_id = 5 and stock >= 1' at line 3]