RE: SQL subquery question
Posted in 1999
Under certain conditions for x and y (such as being fixed length
strings) you could use;
Select *
From a
Where x||y not in (select x||y from b);
Otherwise the only thing I can come up with is;
Select primary_key from a
Where a.x = b.x
And a.y = b.y
Into temp found;
Select primary_key
From a
Where primary_key not in (select * from found);
HTH
-----Original Message-----
From: Geoffrey Poole [SMTP:Geoffrey.Poole@ogs.co.uk]
Posted At: Wednesday, May 12, 1999 11:04 AM
Posted To: Informix
Conversation: SQL subquery question
Subject: SQL subquery question
What is the easiest way to write the following SQL :-
select * from a where (x,y) not in (select x,y from b);
I've a foreign key constraint on 2 columns that has failed to
build so
I'm trying to find the offending rows.
Geoff Poole
geoffrey.poole@ogs.co.uk