亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

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.

正在回答

3 回答

在銷量增加中犯了同樣的錯誤,一開始就認為是sql語句錯了,結果就是這個逗號被直接忽略,在service層浪費了兩個半鐘。。。感謝啊,要是沒你的提示還不知道要搞多久。

0 回復 有任何疑惑可以回復我~

解決了,原來是沒有刪除

set?stock?=?stock?-?#{amount},

這的逗號

11 回復 有任何疑惑可以回復我~

### 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]



0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
SpringBoot構建電商基礎秒殺項目
  • 參與學習       49412    人
  • 解答問題       978    個

應用SpringBoot快速搭建擁有用戶、商品、交易及秒殺活動的電商秒殺應用。

進入課程

mysql語法問題,我使用的mysql是8.0.11

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號