cleey
望着那一丝海线,若隐若现。落日下的海霞,数不尽的美,看不完的醉
Mysql:You can't specify target table 'c_software' for update in FROM clause
mysql查询更新时遇到:You can't specify target table 'c_software' for update in FROM clause

错误语句:
UPDATE `c_software` SET slinkt=concat(slinkt,'3,')
WHERE sid IN (
SELECT sid FROM `c_software`
WHERE slinkt not like '%32,%'
);

解决方法:
UPDATE `c_software` SET slinkt=concat(slinkt,'3,')
WHERE sid IN (
SELECT sid FROM (
SELECT sid FROM `c_software`
WHERE slinkt not like '%32,%') as tmp
);
做一个临时表,就可以解决了,估计mysql内部有限制;
<< 上一篇 HTML详解 css >大于符号 下一篇 >>
文章标签
随意 | Created At 2014 By William Clinton | 蜀ICP备14002619号-4 |