我收到错误:
ERROR 1093 (HY000): You can't specify target table 'postac' for update in FROM clause
查询:
UPDATE postac
SET statek= (
SELECT statek
FROM postac
WHERE nazwa='Bjorn')
WHERE nazwa='*a*';
有人能解决这个问题吗?
答案 0 :(得分:0)
试试这样:
update postac p1
inner join postac p2 on p1.id = p2.id and p2.nazwa='Bjorn'
set p1.statek = p2.statek
where p1.nazwa='*a*'