left join
- December 27, 2011
- Published in MYSQL
{codecitation class="brush:sql" width="500px"}
SELECT `tbl_cours_info`.crs_nom as cours,
concat(`tbl_professeur`.`prof_nom`," ",`tbl_professeur`.`prof_prenom`)as prof,
`tbl_emploi_du_temps`.`empl_jours` as jours,
`tbl_emploi_du_temps`.`empl_heures_begin` as tbegin,
`tbl_emploi_du_temps`.`empl_heures_end` as tend
FROM `tbl_emploi_du_temps`
LEFT JOIN `tbl_cours_info` ON `tbl_emploi_du_temps`.`empl_cours_id` = `tbl_cours_info`.`crs_id`
LEFT JOIN `tbl_professeur` ON `tbl_emploi_du_temps`.`empl_prof_id`= `tbl_professeur`.`prof_id`
ORDER BY `tbl_emploi_du_temps`.`empl_jours` ASC
{/codecitation}