2019-03-19
阅读量:
655
SQL语句报错
问题描述:
执行以下SQL语句:
update t_account set balance=(
select balance-?
from t_account
where account=?)
where account=?;
报错如下:
[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)


暂无数据
推荐帖子
0条评论
0条评论
1条评论