|
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.
|