You are viewing a single comment's thread. Return to all comments →
WITH doctors As ( SELECT Name, ROW_NUMBER() OVER (ORDER BY Name) as rn FROM OCCUPATIONS WHERE Occupation = 'Doctor'), professors AS ( SELECT Name, ROW_NUMBER() OVER (ORDER BY Name) as rn FROM OCCUPATIONS WHERE Occupation = 'Professor'), singers AS ( SELECT Name, ROW_NUMBER() OVER (ORDER BY Name) as rn FROM OCCUPATIONS WHERE Occupation = 'Singer'), actors AS ( SELECT Name, ROW_NUMBER() OVER (ORDER BY Name) as rn FROM OCCUPATIONS WHERE Occupation = 'Actor') SELECT d.Name, p.Name, s.Name, a.Name FROM Doctors AS d FULL OUTER JOIN Professors AS p ON d.rn = p.rn FULL OUTER JOIN Singers AS s ON p.rn = s.rn FULL OUTER JOIN Actors AS a ON s.rn = a.rn``
Seems like cookies are disabled on this browser, please enable them to open this website
Occupations
You are viewing a single comment's thread. Return to all comments →