Add Column Using Count

%3CLINGO-SUB%20id%3D%22lingo-sub-784706%22%20slang%3D%22en-US%22%3EAdd%20Column%20Using%20Count%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-784706%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20add%20a%20column%20named%20Past12%20to%20my%20table%20wynne_incidents.%20I%20want%20to%20count%20all%20the%20distinct%20incident_num%20by%20employ_id.%20So%20basically%2C%20I%20am%20counting%20the%20number%20of%20incidents%20(incident_num)%20for%20each%20employee%20(employ_id).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20this%20query%20which%20pulls%20the%20data%20correctly.%20Now%20I%20just%20need%20to%20know%20how%20to%20use%20it%20with%20ALTER%20TABLE%20and%20ADD%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-php%22%3E%3CCODE%3Eselect%20count(distinct%20incident_num)as%20%22Past%2012%22%2C%20employ_id%0Afrom%20wynne_incidents%0Awhere%20inc_date%20%26gt%3B%3D%20'04%2F01%2F2019'%20and%20inc_date%20%26lt%3B%3D%20'06%2F30%2F2019'%0Agroup%20by%20employ_id%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-784706%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eadding%20columns%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EColumns%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecount%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDISTINCT%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Regular 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!