group by在聚合时通过条件将group by内部多条分组聚合(case when为条件)
WITH c_temp AS
(SELECT avg(CASE
WHEN d<'20201102' THEN cnt
ELSE 0
END) AS avg_7,
sum(CASE
group by在聚合时通过条件将group by内部多条分组聚合(case when为条件)
WITH c_temp AS
(SELECT avg(CASE
WHEN d<'20201102' THEN cnt
ELSE 0
END) AS avg_7,
sum(CASE