Add Column Using Count

Steel Contributor

I am trying to add a column named Past12 to my table wynne_incidents. I want to count all the distinct incident_num by employ_id. So basically, I am counting the number of incidents (incident_num) for each employee (employ_id).

 

I have this query which pulls the data correctly. Now I just need to know how to use it with ALTER TABLE and ADD

select count(distinct incident_num)as "Past 12", employ_id
from wynne_incidents
where inc_date >= '04/01/2019' and inc_date <= '06/30/2019'
group by employ_id

Thank you!

0 Replies