摘要: MySQL update中使用select:You can't specify target table 'xxx' for update in FROM clause 问题 【问题】想通过update更新某个查询的合计值,这样就可以不用查询两次了(一个查询统计总数,一个更新表中的数据) 【原因】update语句不能包含select的查询结果 不能通过 update a set a.xx= (select xx from b) 必须使用 join 进行连接 update 阅读全文
posted @ 2022-09-17 13:32 changlinlo 阅读(74) 评论(0) 推荐(0) 编辑