new_accounts_per_day.sql

11 lines | 248 B Blame History Raw Download
create or replace view v_new_accounts_per_day as
select
  date_format(created_date, '%Y-%m-%d') as day
, count(*) as count
from bac
where created_date > date_sub(curdate(), interval 90 day)
and created_date <= curdate()
group by 1
order by 1 asc
;