0
select ds.school_name_np,
case
when (ds.gender_id = 1 and ds.class=1) then ds.no_of_student
end as boys_1,
case
when (ds.gender_id = 2 and ds.class=1) then ds.no_of_student
end as girls_1,
case
when (ds.gender_id = 1 and ds.class=2) then ds.no_of_student
end as boys_2,
case
when (ds.gender_id = 2 and ds.class=2) then ds.no_of_student
end as girls_2
from data_047_differntly_abled_school_summary ds
-- GROUP BY school_name_np, gender_id, class, no_of_student
ORDER BY school_name_np
に行をマージ?PostgreSQLのクエリは、私は次のように結果を生成し、上記のクエリを持って1
'' BY ... HAVING string_agg'と 'GROUPをarray_agg'か...' –