Re: SQL help needed

2016-11-27 Thread John English
On 27/11/2016 18:29, Rick Hillegas wrote: Hi John, The outer join is the typical SQL approach to computing the difference between two relations: select * from x left join y on x.a = y.a and x.b = y.b where y.a is null; Ah, excellent: very clever. This looks like the perfect solution!

Re: SQL help needed

2016-11-27 Thread John English
On 27/11/2016 17:36, Zorro wrote: Can't you use an ordinary join ? Something like Select x.* From x, y Where x.a = y.a And x.b = y.b That would work if I wanted all (a,b) from X where (a,b) occurs in Y; unfortunately what I want is all (a,b) from X where (a,b) DOES NOT occur in Y. -- John

Re: SQL help needed

2016-11-27 Thread Rick Hillegas
Hi John, The outer join is the typical SQL approach to computing the difference between two relations: select * from x left join y on x.a = y.a and x.b = y.b where y.a is null; Hope this helps, -Rick On 11/27/16, 2:13 AM, John English wrote: I'm trying to find all rows in a table

Re: SQL help needed

2016-11-27 Thread Zorro
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

Re: SQL help needed

2016-11-27 Thread Thomas Meyer
Am 27. November 2016 11:13:33 MEZ, schrieb 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