On 2015-09-22 11:17 PM, ChingChang Hsiao wrote: > SELECT * FROM service_table AS a > LEFT JOIN service_fib_table AS b ON a.service_no=b.service_no ; > > > How about adding one more further conditional JOIN in one statement above. > > service_fib_table.fib_id=service_fib_port_table.fib_id > > It means there is a hierarchy > service_table->service_fib_table->service_fib_port_table.
Oops, did not finish... SELECT * FROM service_table AS a LEFT JOIN service_fib_table AS b ON a.service_no=b.service_no AND a.species=b.species AND b.class='Donkey' AND a.points < b.points LEFT JOIN service_fib_table2 AS c ON c.service_no=a.service_no LEFT JOIN service_fib_table3 AS d ON d.service_no=a.service_no ; etc. You may well add the same table more than once even if that is helpful . very few restrictions on joining things.