Re: Opposite selection...

2003-02-06 Thread Brent Baisley
I think you are coming from the wrong angle. If you want the opposite, you should reverse your approach. Select all the names in the projects table, match them with names in the contacts, then filter it so you only have the ones without a match. SELECT p.name,p.company FROM projects p LEFT

RE: Opposite selection...

2003-02-06 Thread Jennifer Goodie
, February 04, 2003 9:25 AM To: [EMAIL PROTECTED] Subject: Opposite selection... Ok I'm stumped on what I think should be a somewhat simple query. What I have so far is a list of names that is in a list of projects AND in a the main contact list by doing the following query: SELECT p.name, p.company FROM

Re: Opposite selection...

2003-02-05 Thread Nasser Ossareh
refer to 1.7.4.1 Subselects in the manual for the answer. here's a brief example: The queries: SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2); SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2 WHERE table1.id=table2.id); Can be rewritten as: SELECT table1.* FROM

Re: Opposite selection...

2003-02-05 Thread Brian Lindner
Nicholas, Tuesday, February 4, 2003, 12:25:08 PM: Ok I'm stumped on what I think should be a somewhat simple query. What I have so far is a list of names that is in a list of projects AND in a the main contact list by doing the following query: SELECT p.name, p.company FROM contacts c,

Re: Opposite selection...

2003-02-05 Thread Benjamin Pflugmann
Hi. On Tue 2003-02-04 at 12:25:08 -0500, [EMAIL PROTECTED] wrote: Ok I'm stumped on what I think should be a somewhat simple query. What I have so far is a list of names that is in a list of projects AND in a the main contact list by doing the following query: SELECT p.name, p.company FROM

Opposite selection...

2003-02-04 Thread Nicholas Stuart
Ok I'm stumped on what I think should be a somewhat simple query. What I have so far is a list of names that is in a list of projects AND in a the main contact list by doing the following query: SELECT p.name, p.company FROM contacts c, projects p WHERE CONCAT(c.firstName, , c.lastName) = p.name