mysql update 批量更新

UPDATE cntheater SET title = (SELECT title FROM cntheater_copy WHERE cntheater.id = cntheater_copy.id) 

 

 

将查询结果作为新表在进行子查询

select * from(SELECT
COUNT(*) as totalcount,
place,
title,
CONCAT("li" "qw") as name,
(select IFNULL(1/0,'yes')) as istrue
FROM
cntheater
GROUP BY title) as newTable WHERE totalcount=2

posted on 2014-03-07 10:52  李乐已存在  阅读(225)  评论(0编辑  收藏  举报

AmazingCounters.com