J'ai juste inversé
groupe.establishment_id = blish.group_establishment
par
blish.establishment_id = groupe.group_establishment
il n'y a pas le groupe dans la table establishment mais dans establish.
Par contre ça me renvoie quand même NULL.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 SELECT hot.name, hot.first_name, esta.establishment_id, esc.group_establishment, groupe.label, esc.collectivite_id FROM imghotline.hotline_user AS hot INNER JOIN imghotline.establishment_user AS esta ON hot.hotline_user_id = esta.hotline_user_id INNER JOIN imghotline.establish AS esc ON esta.establishment_id = esc.establishment_id INNER JOIN imghotline.establishment AS blish ON blish.establishment_id = esta.establishment_id LEFT OUTER JOIN imghotline.establish AS groupe ON blish.establishment_id = groupe.group_establishment AND blish.establishment_id <> 0 ORDER BY hot.name
Partager