Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

How can I expand the output of this query

$
0
0

I am writing a query to access health information from my student information system for state and county record compliance. We are using SQL Server 2000 (legacy system) as the backend.

My query thus far is:

select
i.Description Immunization,
Count (LName) AS "Medical Exemption"
from student cross join immunization i left join StImmunization si on si.sno = Student.sno and si.immcode = i.code
where Student.Status = 'A' and i.TotalReq 0
and Exempt = 'I'
Group BY i.Description
My output gives me a column with the name "Immunization" with rows of the different immunization types (polio, chicken pox, hepatitis, etc). The column next to it has the title "Medical Exemption" with corresponding counts in each row below.
Something like this:
Description Medical exemption
Polio 2
MMR 1
Chicken Pox 0
What I would like to...

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>