MySQL Forums
Forum List  »  New in 4.1: Subqueries

SQL rewriting
Posted by: René Speksnijder
Date: January 16, 2006 07:03AM

I do not know if I'm at the right address, but I have some kind of a problem. The situation is like this: I've got wamp installed (Windows Apache MySQL PHP). It seems it includes MySQL version 4.0.18. So no views or subqueries can be used. I do not know howto upgrade MySQL within Wamp so to me that's no option at this point. But then it's the matter with no usage of subqueries. And now I've got a query and I do not know how to write this one down without subqueries. I was wondering if you could help me with it. First of all let me write down the query with subqueries.

Create table temp_coll as
Select C.id, C.naam from collectie C
Where C.cdnr = 1
And (C.id not in (Select U.collid from uitlenen U
Where idat is NULL )
Or NOT EXISTS ( Select U.collid from uitlenen U
where U.collid = C.id ))

You can also leave the create table of course. As you can see that there are two tables involved namely: collectie and uitlenen, and the id in collectie may appear in the table uitlenen as collid.

Options: ReplyQuote


Subject
Views
Written By
Posted
SQL rewriting
3797
January 16, 2006 07:03AM


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.