现在想要这样的效果:
name monthly_count total_count
a 10 20
b 15 25
name 的 monthly_count 取得方法为:
select name, count(*) as monthly_count from table_name where updated_at = yyyymm
total_count 的取得条件是:
select count(*) as total_count from table_name
即不加按月统计。
用一条SQL语句能不能实现呢?