在mysql中,不能直接使用set select的结果,必须使用inner join:
update a inner join (select yy from b) c on a.id =b.id
set a.xx = c.yy
update a inner join (select
ceiling(month(data_time)/3) as season from a
group by ceiling(month(data_time)/3)) c on a.id =a.id
set a.season = c.season
update sta_statistcs as a inner join
(select SUBSTRING_INDEX(
result, ',', 1)
as season from sta_statistcs) c on a.id
=a.id set a.data = c.season
mysql 字段分割符
select SUBSTRING_INDEX(
result, ',' , 1) from
sta_statistcs;