Skip to content
Advertisement

How can i query to get to this result?

Ok, so i can get SELECT * FROM table WHERE string NOT IN ('a','c'):

but i also want to not get the rest of the rows that contain a or c with the same id2. result:

Advertisement

Answer

You can use not exists:

If you just want the id2 values, you might find aggregation convenient:

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