| Article: |
More on JOINS | |
| Subject: | Right outer joins in MS SQL SERVER | |
| Date: | 2003-07-10 11:59:34 | |
| From: | anonymous2 | |
|
Response to: Right outer joins in MS SQL SERVER
|
||
| The first query works as a cross join because you are not telling the system what type of join you want to use. The second one is written properly. | ||
Showing messages 1 through 2 of 2.
-
Right outer joins in MS SQL SERVER
2005-07-17 15:20:59 MJC [View]
NO MESSAGE
-
Right outer joins in MS SQL SERVER
2006-01-28 23:31:14 JCrespin [View]
The answer given is correct. There is a cross join between table titles and table sales as you have not defined the join criteria.
If you want to receive the same result that you receive with the right outer join query you have to define the join between titles and sales (see below)...
select a.au_id, b.title,
c.qty
from titleauthor a,
titles b,
sales c
where
(a.title_id =* b.title_id)
and (a.title_id =* c.title_id)
and (b.title_id = c.title_id)
order by a.title_id
That said, definitely use the second query.


