I have these 3 tables: T1: T2: Service Application | Application Machine ------------------------------------------- network DHCP DHCP mach1 Database SQL SQL mach2 Email Exchange SNMP mach2 network SNMP Exchange mach5 ===== T3: Service Doc/notes ------------------ Network www.google.com Database Test Traning test ---------------- As you can see , some service do not provide any application so they do not have any servers associated with them. First of all is these a good table structure? My actual tables has more columns. The data I am interested in is Service and the application running (if) and the machine related with it (if there's a machine) if not return nothing.
here's my query: $query= "select distinct T3.service, T1.application, T2.machine from T3,T1 LEFT JOIN T2 ON T1.application=T2.application where T1.service=T3.service"; This works and I can format it with php very nicely. But it doesn;t return the data "traning" in T3. Do i need another join? Any hint? let me know if its not clear enough. Thanks for your help. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php