(created_at, month) as signup_month from users
-- Bad select id, email, timestamp_trunc(created_at, month...,否则不要包含表名
-- Good
select
id,
name
from companies
-- Bad
select
companies.id,
companies.name...(created_at, month) as signup_month
from users
-- Bad
select
id,
email,
timestamp_trunc(...from charges
group by 1
22、分组的列首先显示出来
-- Good
select
timestamp_trunc(com_created_at, year) as signup_year...,
timestamp_trunc(com_created_at, year) as signup_year
from companies
group by signup_year
23、调整对齐case-when