자료구조 알고리즘/코딩테스트

1795. Rearrange Products Table

내공얌냠 2022. 5. 30. 21:47

https://leetcode.com/problems/rearrange-products-table/

 

Rearrange Products Table - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

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
반응형