View Single Post
Old 02-17-2013, 01:30 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,567
Thanks: 62
Thanked 4,057 Times in 4,026 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I don't get it. Why do you need that first query, at all???

What's wrong with simply
Code:
SELECT m.title, m.whatever, m.otherstuff, GROUP_CONCAT(g.genre) AS genres 
FROM movies m  
INNER JOIN moviegenres mg ON (mg.movie_id = m.id)  
INNER JOIN genres g ON (g.id = mc.genre_id)  
GROUP BY m.id
ORDER BY m.id
LIMIT 4
???
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
destas (02-20-2013)