MySQL Forums
Forum List  »  Newbie

LEFT JOIN PROBLEM
Posted by: JPM van de Mossealer
Date: June 28, 2005 06:17AM

its strange but IMAGES,RATINGS,COMMENTS are exactly the same and they need to be differnt, Am i doing something wrong?

SELECT users.*,COUNT(images.id) AS images,COUNT(ratings.id) AS ratings,COUNT(comments.id) AS comments
FROM users
LEFT JOIN images ON users.id=images.userid
LEFT JOIN comments ON users.id=comments.userid
LEFT JOIN ratings ON users.id=ratings.userid
GROUP BY users.id

Options: ReplyQuote


Subject
Written By
Posted
LEFT JOIN PROBLEM
June 28, 2005 06:17AM
June 28, 2005 08:10PM


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.