SQL Full Outer JOIN
SQL
Download (.zip)
USE pubs GO SELECT 'Author'=RTRIM(au_lname) + ', ' + au_fname, 'Title'=title FROM ( -- JOIN CONDITIONS -- FIRST join authors and titleauthor (authors AS A FULL OUTER JOIN titleauthor AS TA ON A.au_id=TA.au_id ) -- The result of the previous join is then joined to titles FULL OUTER JOIN titles AS T ON TA.title_id=T.title_id ) WHERE state <> 'CA' OR state IS NULL ORDER BY 1
|