David Heald wrote:
> I'm moving some SQL to a 4.0.18 server and I have
> to change the SQL to get rid of subqueries. Here
> is a fake example that illustrates my problem:
> ...
> mysql> select * from booklist where price <
> 5 and book_id NOT IN (
> -> select book_id from booksowned where
> user_id = 1);
> | book_id | name | price |
> | 23 | Lord of the Flying Rings | 3 |
> | 26 | Advanced SQL for twits | 4 |
>
> Can I write the above query, without the NOT IN
> clause? Thanks,
> ...
I know its not really answering your question, but you could consider
moving to a 4.1.10 MySQL server which does support subqueries.
Regards,
Josh
Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL!
http://www.mysql.com/consulting