https://leetcode.com/problems/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
반응형
'자료구조 알고리즘 > 코딩테스트' 카테고리의 다른 글
176. Second Highest Salary (0) | 2022.05.30 |
---|---|
608. Tree Node (0) | 2022.05.30 |
1965. Employees With Missing Information (0) | 2022.05.30 |
1527. Patients With a Condition (0) | 2022.05.30 |
1484. Group Sold Products By The Date (0) | 2022.05.30 |