Skip to content

Commit

Permalink
easy 1795
Browse files Browse the repository at this point in the history
  • Loading branch information
samjazaaa committed Sep 26, 2022
1 parent bdb757f commit c905380
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/easy/1795-rearrange-products-table/products.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- 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
;

0 comments on commit c905380

Please sign in to comment.