17. 멀티 플랫폼 게임 찾기

2024-12-19

select name
from (
	select
		g.name
		, case when p.name in ('PS3', 'PS4', 'PSP', 'PSV') then 'Sony'
			when p.name in ('Wii', 'WiiU', 'DS', '3DS') then 'Nintendo'
			when p.name in ('X360', 'XONE') then 'Microsoft'
		end as major_platform
	from
		games g
	inner join platforms p on p.platform_id = g.platform_id
	where year >= 2012 and major_platform is not null
	group by g.name, g.platform_id
) m
group by name
having count(distinct(major_platform)) >=2

올라프의 함정에 빠지지 않도록 다들 조심해 ...