99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2019-02-14 閱讀量: 883
sql嵌套語句報(bào)錯(cuò)

問題描述:

數(shù)據(jù)庫用的是MySQL,想拼接一個(gè)SQL查詢語句,語句中問號(hào)的地方是參數(shù),但是自己在測試SQL語句的時(shí)候,把那3個(gè)參數(shù)寫死更新數(shù)據(jù)也沒起作用,正確的SQL應(yīng)該怎么寫?

數(shù)據(jù)表的內(nèi)容如下:

SQL語句如下:

update t_account set balance=(
select balance-?
from t_account
where account=?)
where account=?;

報(bào)錯(cuò)如下:

[SQL] update t_account set balance=(

select balance-200

from t_account

where account=12345)

where account = 12345;

[Err] 1093 - You can't specify target table 't_account' for update in FROM clause

解決方法:

update t_account set balance=balance-?
where account=?;
0.0000
3
關(guān)注作者
收藏
評(píng)論(0)

發(fā)表評(píng)論

暫無數(shù)據(jù)
推薦帖子