At 4:40 PM -0700 9/7/01, Anthony E. wrote:
>I've tried to do a NOT IN statement, but still am
>getting SQL syntax error.
>
>
>SELECT COUNT(*) FROM USER_TMP WHERE USER_TMP.email NOT
>IN (SELECT USER.email FROM USER);
>
>I'm trying to produce a list of records from USER_TMP
Huh? COUNT(*) produces a count, not a list.
>table where the USER_TMP.email is NOT IN USER.email.
>
>(in other words, i want only the records where the
>email address from USER_TMP is not already in USER).
>
>Please help, i've been strugglying on this all day.
You're trying to use a sub-select, and MySQL doesn't
support them yet. You can probably get what you want
with a LEFT JOIN, however:
SELECT USER_TMP.email FROM USER_TMP LEFT JOIN USER USING (email)
WHERE USER.email IS NULL
>=====
>--
>Anthony Ettinger
>[EMAIL PROTECTED]
>415-504-8048
>http://chovy.com/resume.doc
--
Paul DuBois, [EMAIL PROTECTED]
---------------------------------------------------------------------
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