MySQL Forums
Forum List  »  Newbie

Convert Query from using Subqueries, compatible with MySQL 3.23
Posted by: grishamjosh
Date: April 04, 2005 11:50AM

Can someone give me some tips on how I should rewrite this query to work with MySQL 3.23 (no subqueries)

I've been wracking my brain a bit.. the only things I can come up with is to either have the application handle 2 data sets and put them together there, or .. put a "blank" (so to speak) record in the table for each user, for each group...

select g.id, g.name, g.description, p.permission from groups g left join (select * from permissions where id=3) p on g.id=p.group_id or p.group_id Is Null;

(wrote that off the top of my head .. don't remember if MySQL uses "select ... from table t" or "select ... from table as t" ..but should get the point across I think)

Anyone have any ideas?

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Convert Query from using Subqueries, compatible with MySQL 3.23
April 04, 2005 11:50AM


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.