SQL for Smarties | SQL Programming Style | Trees and Hierarchies in SQL | SQL Puzzles and Answers | Data and Databases

Wednesday, May 17, 2006

Using inner and outer joins in the same query

SQL Apprentice Question
Can anyone tell me if it is bad practice to use both an INNER JOIN and
an LEFT OUTER JOIN in the same query on SQL Server 2000?

Celko Answers
Not a problem, but remember that they are executed in left to right
order, so you may want to use parens and/or make derived tables out of
some of the results. Look up the scoping rules for the FROM clause.

No comments: