|
Home > Archive > PostgreSQL Newbies > July 2005 > help with a simple SQL query
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
help with a simple SQL query
|
|
| Andrew Stuart 2005-07-24, 11:31 am |
| Hello
I'm a newb. I'd love some help solving this apparently simple query.
table one contains email sender addresses
table two contains emails
From table two I wish to SELECT all emails whose sender address is not in
table one.
Can anyone suggest how this might be done?
Thanks in advance
Andrew Stuart
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
| |
| Derrick Betts 2005-07-24, 11:31 am |
| SELECT emails FROM table2 WHERE sender_address NOT IN (SELECT sender_address
FROM table1);
That should work.
Derrick
----- Original Message -----
From: "Andrew Stuart" <andrew. stuart@flatraterecru
itment.com.au>
To: <pgsql-novice@postgresql.org>
Sent: Wednesday, July 20, 2005 4:11 AM
Subject: [NOVICE] help with a simple SQL query
> Hello
>
> I'm a newb. I'd love some help solving this apparently simple query.
>
> table one contains email sender addresses
> table two contains emails
>
> table one.
>
> Can anyone suggest how this might be done?
>
> Thanks in advance
>
> Andrew Stuart
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
| |
| Obe, Regina DND\\MIS 2005-07-25, 9:29 am |
| SELECT table2.*
FROM table2 LEFT JOIN table1 ON table2.email = table1.email
WHERE table1.email is null
-----Original Message-----
From: Andrew Stuart [mailto:andrew. stuart@flatraterecru
itment.com.au]
Sent: Wednesday, July 20, 2005 6:11 AM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] help with a simple SQL query
Hello
I'm a newb. I'd love some help solving this apparently simple query.
table one contains email sender addresses
table two contains emails
From table two I wish to SELECT all emails whose sender address is not in
table one.
Can anyone suggest how this might be done?
Thanks in advance
Andrew Stuart
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
|
|
|
|
|