Skip to content
Advertisement

Spring Find by unique properties

Given 1 relational table

Doctor_ID Client_ID
2 2
2 3
2 4
3 5
4 2
4 3

And I want all the occurrences where client_id is not equals to 3, ignoring the same doctor_id.

In this example, I would only get the 4th row…

Doctor_ID Client_ID
3 5

How could I achieve something like that?

Advertisement

Answer

This query with NOT EXISTS will give you the results needed.

JavaScript

The NOT EXISTS will filter out ant doctor id that has a client id equals to 3.

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