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
, 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
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
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,
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
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