You are viewing a single comment's thread. Return to all comments →
MySQL
SELECT d.name, p.name, s.name, a.name FROM (SELECT name, ROW_NUMBER() OVER (ORDER BY name ASC) AS id FROM OCCUPATIONS WHERE Occupation = "Doctor") AS d RIGHT JOIN (SELECT name, ROW_NUMBER() OVER (ORDER BY name ASC) AS id FROM OCCUPATIONS WHERE Occupation = "Professor") AS p ON d.id = p.id LEFT JOIN (SELECT name, ROW_NUMBER() OVER (ORDER BY name ASC) AS id FROM OCCUPATIONS WHERE Occupation = "Singer") AS s ON p.id = s.id LEFT JOIN (SELECT name, ROW_NUMBER() OVER (ORDER BY name ASC) AS id FROM OCCUPATIONS WHERE Occupation = "Actor") AS a ON p.id = a.id
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 →
MySQL