Skip to content
Advertisement

Filter Count Clause – One to Many relationship

I currently have two table where a versionLog can contain many ProductVersions.

Following Sql Query:

produces a result set similar to

etc..

How can I limit the result set to only return Versionlogs with a ProductVersion Count = 0?

According to google I’ll need to use the Having clause?

Advertisement

Answer

Using HAVING:


And without grouping:

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