Op 27-11-2016 om 11:13 schreef John English:
I'm trying to find all rows in a table where a pair of values is not in anther table: that is, I want to do something like this:

  SELECT * FROM x WHERE (a,b) NOT IN (SELECT DISTINCT a,b FROM y);

which of course doesn't work.

At the moment I've bodged around it by doing this:

SELECT * FROM x WHERE a||'-'||b NOT IN (SELECT DISTINCT a||'-'||b FROM y);

but this strikes me as really ugly. Can anyone a more elegant way to get what I want?

TIA,

Can't you use an ordinary join ?

Something like
Select x.* From x, y Where x.a = y.a And x.b = y.b

Regards,
Harm-Jan

Reply via email to