On Friday 07 September 2001 23:37, Anthony E. wrote:
> i have two tables with similar structure...
>
> i want to find the intersection of data between two
> tables that have the same email address.
>
>
> I tried the following with an error (Unknown table
> 'USER' in where clause) the USER table is definitely
> there though:
>
>
> select count(email) from USER_TMP where USER_TMP.email
> = USER.email;

Tell MySQL you want to access the table USER as well:

SELECT COUNT(email) FROM USER_TMP, USER 
 WHERE USER_TMP.email=USER.email

(the FROM-clause contains the names of all tables you reference in the query, 
not just the ones you select)

(...)

HTH

Ian Barwick

-- 
Ian Barwick - Developer  [EMAIL PROTECTED]
http://www.akademie.de

"Luncheon meat tables with MySQL data"

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to