I have a table with status column. I want an Oracle sql query which will list me count of rows in each status in only one row. for eg if my table is
Table A
select fkey, sum(case when status = 20 then 1 else 0 end) as count_status20, sum(case when status = 30 then 1 else 0 end) as count_status30, sum(case when status = 40 then 1 else 0 end) as count_status40, from your_table group by fkey