Re: MySQL and NOT INTO ...
| From: | php3 at developersdesk dot com | Date: | Tue, 18 Jul 2000 01:14:13 +0000 |
| Subject: | Re: MySQL and NOT INTO ... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1221@lists.php.net to get a copy of this message | ||
Addressed to: "Ingo Theiss" <Theiss@medizin-forum.de>
php-db@lists.php.net
** Reply to note from "Ingo Theiss" <Theiss@medizin-forum.de> Mon, 17 Jul 2000
11:38:10 +0200
>
> Hi,
>
> I got a really big problem and hope you guys can help me out :
>
> For example I ve got two tables:
>
> Table_A: Table_B:
> 1 2
> 2 4
> 3 7
> 4 9
> 5
> 6
> 7
> 8
> 9
> and I want to select all values From Table_A which are not in Table_B
> ! How is is it possible to do that ? It would be very nice if someone
> could give me an example.
Assuming the columns are named data in both tables:
SELECT Table_A.Data
FROM Table_A
LEFT JOIN Table_B USING ( Data )
WHERE Table_B.Data IS NULL
If The Columns are named DataA and DataB it would be
SELECT Table_A.DataA
FROM Table_A
LEFT JOIN Table_B ON Table_A.DataA = Table_B.DataB
WHERE Table_B.DataB IS NULL
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com