리트코드(LeetCode) SQL 문제풀이 - 1795. Rearrange Products Table
2023. 1. 22. 16:53ㆍ코딩테스트/리트코드(LeetCode) - SQL Study Plan
MySQL 문제 1795. Rearrange Products Table
select product_id, 'store1' as store, store1 as price
from Products
where store1 is not null
union
select product_id, 'store2' as store, store2 as price
from Products
where store2 is not null
union
select product_id, 'store3' as store, store3 as price
from Products
where store3 is not null
728x90
'코딩테스트 > 리트코드(LeetCode) - SQL Study Plan' 카테고리의 다른 글
리트코드(LeetCode) SQL 문제풀이 - 176. Second Highest Salary (0) | 2023.01.23 |
---|---|
리트코드(LeetCode) SQL 문제풀이 - 608. Tree Node (0) | 2023.01.23 |
리트코드(LeetCode) SQL 문제풀이 - 1965. Employees With Missing Information (0) | 2023.01.22 |
리트코드(LeetCode) SQL - 1527. Patients With a Condition (0) | 2023.01.06 |
리트코드(LeetCode) SQL - 1484. Group Sold Products By The Date (1) | 2023.01.05 |