Eh bien, je suis 3 tables:Problème avec MySQL multiple gauche rejoindre et groupe par
TB1:
tb1_id PK
tb1_name
TB2:
tb2_id PK
tb1_id FK
TB3:
tb3_id PK
tb2_id FK
et je suis arrivé cette requête:
select a.tb1_nome
,b.tb2_id
,count(c.tb2_id) as lins
from tb1 a
left join tb2 b on a.tb1_id=b.tb1_id
left join tb3 c on b.tb2_id=c.tb2_id
group by b.tb2_id order by a.tb1_id desc
mais il n'a pas renvoie toutes les lignes de TB1.