Postgresql – Using field alias from main query in a subquery
I want to filter in subquery with aliased field from main query: select a.created_at::date as creation_date, a.column as col1, (select count(*) from table b where a.col1 = b.col1 and a.created_at::date = b.created_at::date) as count_one from table a group by creation_date,…