[프로그래머스 SQL 고득점 Kit] SELECT - 업그레이드 된 아이템 구하기

Jimin·2025년 1월 7일
0
post-thumbnail

https://school.programmers.co.kr/learn/courses/30/lessons/273711

SELECT ITEM.ITEM_ID, ITEM.ITEM_NAME, ITEM.RARITY
FROM 
(SELECT II.ITEM_ID, II.ITEM_NAME, II.RARITY, IT.PARENT_ITEM_ID
 FROM ITEM_INFO II JOIN ITEM_TREE IT ON II.ITEM_ID = IT.ITEM_ID 
) AS ITEM
JOIN 
(SELECT * FROM ITEM_INFO II WHERE II.RARITY = 'RARE') AS II
ON ITEM.PARENT_ITEM_ID = II.ITEM_ID
ORDER BY ITEM.ITEM_ID DESC
profile
https://github.com/Dingadung

0개의 댓글