how to get column count in postgreSQL i have a query below 

select emp_id,
  sum(case when leave_type = 'Planned' then 1 else 0 end) Planned,
  sum(case when leave_type = 'Not Informed' then 1 else 0 end) NotInformed,
  sum(case when leave_type = 'Informed' then 1 else 0 end) Informed
from table where activity_type='Leave'
group by emp_id


it gives below result 



how to get count for above columns for 567 it will display 3
and for 619 it will display 4 in separate column please help
Add a COUNT() column:

select emp_id,
  sum(case when leave_type = 'Planned' then 1 else 0 end) Planned,
  sum(case when leave_type = 'Not Informed' then 1 else 0 end) NotInformed,
  sum(case when leave_type = 'Informed' then 1 else 0 end) Informed,
  count(*) as Total
from t
where activity_type='Leave'
group by emp_id;




emp_id | planned | notinformed | informed | total
-----: | ------: | ----------: | -------: | ----:
   619 |       2 |           1 |        1 |     4
   567 |       0 |           3 |        0 |     3



db&lt;>fiddle here