I have a table which contains property information, with a unique id.
I have a table with client information, which has a unique id.
I have a table where it I calculate how 'relevant' the property is to the client.
Is there a way, using one query to find out which property id and client id pairs don't exist in the relevant table?
How to find what foreign relations don't exist...
Moderator: General Moderators
It looks like that example has only two tables, whereas my situation uses three... I don't know how I can apply it.
I came up with that, but idk if that is the best way to do it, I feel like I don't need a subquery.
Code: Select all
select property.id, client.id from property, client where ( select count(*) from relevance where property_id = property.id and client_id = client.id ) = 0;I came up with that, but idk if that is the best way to do it, I feel like I don't need a subquery.