Re: OT: MySQL syntax help

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Brown
Date:  
To: Main PLUG discussion list
Subject: Re: OT: MySQL syntax help
>>> I need a query to pull every row from Table2 where the "kernel" field
>>> matches ANY row in Table1. Any ideas???
>> See docs for EXISTS
>
> PERFECT! Thanks Darrin! Something like this will work.
>
> SELECT *
> FROM Table2
> WHERE EXISTS
>   (select *
>     from Table1
>     where kernel = Kernel);


SELECT *
FROM Table2
WHERE EXISTS
   (select kernel
     from Table1
     where kernel = Kernel);


Try to avoid the * if you don't really need to select all the data from
all the fields of a table. It might not seem like much, but it adds up
as the tables grow larger.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss