Skip to content
Advertisement

How to exclude certain entries from a query [SQL]

I do have the following issue: Let’s say you have a table that looks like this:

Question: I want to have an query which will deliver all the NotPrimID‘s which do have the Number as 13, however if the Number of a NotPrimID is also 14 etc. it should be automatically excluded from the list.

Advertisement

Answer

You could use exists logic here:

Demo

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