1.merge1表增加一字段cnt :(1)根据ID_01分组,统计数量cnt。(2)根据ID_01更新merge1表中的cnt字段
2.one-hot编码,然后线性回归。
操作:
1.
(1)
create table tmp1(ID_01 varchar(100),cnt varchar(21));
insert into tmp1 select ID_01,count(*) from merge_02 GROUP BY ID_01 ;
(2)
update a set a.cnt = b.cnt
from merge_02_copy1 a
INNER JOIN tmp1 b on b.ID_01 = a.ID_01;