SQL 我要统计某一个表中的数量 更新进另一个表中

来源:百度知道 编辑:UC知道 时间:2024/06/13 17:08:01
insert into 新表(字段1) select count(*) from 旧表 where 某字段 is null

这是插入 我想要更新的语句
update
更新在 新表中 字段值为 游戏名 的行中 请教怎么写

update 表 set 数量=你统计出来的数量 where 游戏名='XXX'

update b
set b.字段1=a.con
from (select 游戏名,count(*) con from 旧表 where 某字段 is null group by 游戏名)a,新表 b
where a.游戏名=b.游戏名 and b.游戏名='XXXX'