Tuesday, March 20, 2012

3 table join

Does anyone know how to construct a select statement for a
3 table join ?. I want a left join with the table1 and
table2, then I want an inner join with table2 and table3.
Can this be done ? If so how can a Select statement would
be?
Thanks for any help.
Mike.
There is a 3 table join example in BOL [Index: SELECT, examples (example
B)]. There are also a number of outer join examples [Index: outer joins,
using outer joins]. Why not take a chance and try it yourself?
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.
|||When joining two tables you will have one JOIN and (at least) one ON.
When joining three tables you will have two JOINs and (at least) two ONs.
You will want to join on your primary/foreign key(s).
Give it a shot. post back to the newsgroups if you get stuck.
Keith
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.

No comments:

Post a Comment