View Single Post

  #1 (permalink)  
Old 04-19-2008
avilella
 
Posts: n/a
Default select all different fields but only one for the common in join

Hi,

I want to do a join for 4 tables on field "id" and "type" but I only
want to have "id" and "type" shown once, then have all the other
fields, that are unique in the table, also shown. Something like:

select // id and type once, then all fields
from table_11 t1, table_12 t2, table_21 t3, table_22 t4
where t1.id=t2.id and
t2.id=t3.id and
t3.id=t4.id and
t1.type=t2.type and
t2.type=t3.type and
t3.type=t4.type limit 5

Any ideas?

Cheers
Reply With Quote