如何通过修改现有查询来获得期望的结果?

时间:2019-03-12 21:46:43

标签: sql oracle pivot

SELECT NAME, TITLE_ID
FROM NAME
INNER JOIN KNOWN_FOR_TITLES USING (NAME_ID)
INNER JOIN NAMES_PROFESSIONS USING (NAME_ID)
INNER JOIN PROFESSIONS USING (PROFESSION_ID)
WHERE PROFESSIONS = 'actor' OR PROFESSIONS = 'actress'
ORDER BY NAME_ID;

Result I get when I run the query above

The desired result:

0 个答案:

没有答案