MySQL Forums
Forum List  »  General

Re: rewriting subqueries
Posted by: Josh Chamas
Date: March 23, 2005 02:57AM

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

Options: ReplyQuote


Subject
Written By
Posted
February 21, 2005 09:19PM
Re: rewriting subqueries
March 23, 2005 02:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.