I want this to work:WITH account_status AS (select CASE WHEN regdate = 1 THEN 'yes' WHEN regdate = 2 THEN 'no'end as status_a,count(t2.id) as t2_count from test1 as t1join test2 as t2 on t2.test1_id = t1.id end as status_a)select status_a, t2_count,count(*)from account_status group by status_a, t2_count
WITH account_status AS (select CASE WHEN regdate = 1 THEN 'yes' WHEN regdate = 2 THEN 'no'end as status_a,count(t2.id) as t2_count from test1 as t1join test2 as t2 on t2.test1_id = t1.id end as status_a)select status_a, t2_count,count(*)from account_status group by status_a, t2_count
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных