> >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
> >----------------
> >
> >$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";
> >

Yes, you need another left join.

select distinct t3.service, t1.application, t2.machine from t3 left join t1 on 
t1.service=t3.service left join t2 on t1.application=t2.application

Steve Meyers



---------------------------------------------------------------------
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

Reply via email to