Currently I have 2 tables. Service 1 name and Service info.
I need to grab all Unique names from service name and show how many service infos are attached to it eg.
SELECT cs.serviceDesc as 'SERVICE', COUNT(cr.serviceId) as 'Count',
FROM consultationRequests cr
JOIN consultationServices cs on cs.serviceId = cr.serviceId
JOIN demographic d on d.demographic_no = cr.demographicNo
WHERE cs.active = 1
AND cr.referalDate between '2018-11-31' and '2019-01-20'
GROUP BY cr.serviceId
There is also another column in consultationRequests that has a status number between 1-4. I need to add in another column for each status and count the number of infos that are within that status WITHIN the service name.