关于set 后面的语句~
update products set prod_price= (select if((select(select prod_price from products where prod_id='FB')+10)<10002,(select(select prod_price from products where prod_id='FB')+10),10002)) where vend_id=10001;为什么会报You can't specify target table 'products' for update in FROM clause这个错误 应该怎么写~
亲各位高手帮一下啊 汗,楼主就不能分开写?这样自己看着都累,调试也困难 回复 2# visvoy
俺不会分开写 分开写也不对~ 反正就是错 麻烦你告诉俺怎么错了 怎样写才能实现这个功能? 解决啦~终极方案~
update products set prod_price= if((prod_price +10)<10002, prod_price +10,10002)) where vend_id=10001;
错误原因是因为使用if会获取prod_price 所以不用select语句把他获取了~
页:
[1]