I am querying my database for demographic information. I have several statements that are similar so if I get a couple of these with the correct syntax than I should be alright.
I would like the line below to output all Hispanic, Non -Catholic, individuals. I don't want to include nulls or "NR" (not registered) values in the output.
Here is the line I have:
SUM(CASE WHEN ethnic='H' AND (s.religion_ <>'Catholic' AND s.religion_ <> 'NR' AND s.religion_ is not null) and s.status='A' then 1 else 0 end) ,
Should the s.religion_ values use "AND" or "OR"?
Hope this makes sense