I'm trying to use the "IN" operator as described in my databases textbook 
from college.  This query:

select count(*) from user where user.ID in (select ID from user);

is supposed to evaluate to "count the number of rows in the 'user' table 
where the ID field is in the set of all ID field values in the 'user' 
table" (in other words, just a roundabout way of counting the rows in the 
'user' table, written solely to demonstrate the "IN" keyword).

There doesn't seem to be a syntax error in that example, but MySQL gives 
the error:

ERROR 1064: You have an error in your SQL syntax near 'select ID from 
user)' at line 1

Is the "IN" keyword not supported in MySQL, or am I using it wrong?

        -Bennett

[EMAIL PROTECTED]     http://www.peacefire.org
(425) 649 9024


---------------------------------------------------------------------
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