MySQL Forums
Forum List  »  Newbie

Re: Multiple left joins and counts
Posted by: Does it matter
Date: May 26, 2015 04:08AM

I was forgetting :

when I was having a LEFT JOIN onto only one table, it seemed to produce the proper result :

SELECT t1.* , COUNT(t2.id)
FROM table1 AS t1
LEFT JOIN
table2 AS t2
ON t1.id_t1 = t2.id_t1
GROUP BY id_t1

Options: ReplyQuote


Subject
Written By
Posted
Re: Multiple left joins and counts
May 26, 2015 04:08AM


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.