Subject | Re: SQL Question |
---|---|
Author | Adam |
Post date | 2005-05-26T01:35:14Z |
Hi Daniel,
You can join to the same table several times as long as you use the
table name alias
eg:
select *
from table1 a
join table2 b on a.id=b.table1id_1 and a1.id = :param
join table2 c on a.id=c.table1id_2
etc
You can also move some the condition to the join because on 1.5 it will
sometimes help the optimiser.
Adam
You can join to the same table several times as long as you use the
table name alias
eg:
select *
from table1 a
join table2 b on a.id=b.table1id_1 and a1.id = :param
join table2 c on a.id=c.table1id_2
etc
You can also move some the condition to the join because on 1.5 it will
sometimes help the optimiser.
Adam