Skip to content
Advertisement

Anyway to add a constraint when using SQL count

I want to to use count to include a criteria where patient doesn’t have diabetetes, and then using the query to

show country that has at least 3 patients that doesn’t have diabetes

How shoudl I be doing this? How can I include a constraint when using count?

yeah I think this should work, basically my logic is not every patient is diabetic. I want to put my query that is grouped by country, so I can show every country that have at least 3 patients that aren’t diabetic.

Advertisement

Answer

I think you want a having clause:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement