goodmood_ch Posted November 14, 2003 Share Posted November 14, 2003 Hello, The most important tables in this query are \"ticket\" and \"employes\" \"ticket\" as an idEmploye (to retrieve the coresponding employe), which can be null I want to list the tickets for all idEmployees ( where null and not null) Here is the query $sql = "SELECT T.idTicket, T.titreTicket , T.dateOuverture, E.nomEtatTicket, T.idEtatTicket, EM.userNameEmpl, T.ouvertPar "; $sql .="FROM tickets T, etatsTickets E, employes EM "; $sql .="WHERE T.idEtatTicket IN (1,2,3) "; $sql .="AND T.idProjet = $idProjet "; $sql .="AND E.idEtatTicket = T.idEtatTicket "; $sql .="AND T.idEmploye *= EM.idEmploye "; <-- Dont know how to make this outer join with mysql Thanks for your answers Quote Link to comment https://forums.phpfreaks.com/topic/1363-outer-join-with-multiple-tables-not-working/ Share on other sites More sharing options...
Barand Posted November 14, 2003 Share Posted November 14, 2003 [php:1:f8e2758d66]<?php $sql = \"SELECT T.idTicket, T.titreTicket , T.dateOuverture, E.nomEtatTicket, T.idEtatTicket, EM.userNameEmpl, T.ouvertPar FROM (tickets T INNER JOIN etatsTickets E ON E.idEtatTicket = T.idEtatTicket ) LEFT JOIN employes EM ON T.idEmploye = EM.idEmploye WHERE T.idEtatTicket IN (1,2,3) AND T.idProjet = $idProjet \"; ?>[/php:1:f8e2758d66] hth Quote Link to comment https://forums.phpfreaks.com/topic/1363-outer-join-with-multiple-tables-not-working/#findComment-4516 Share on other sites More sharing options...
goodmood_ch Posted November 14, 2003 Author Share Posted November 14, 2003 works fine, thanks a lot ! Quote Link to comment https://forums.phpfreaks.com/topic/1363-outer-join-with-multiple-tables-not-working/#findComment-4517 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.