Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SQL - Unpivot Table
with t(id ,loc , val1 ,val2 ,val3 ,val4) as ( select 1 ,'loc1' , 10 ,190 ,null , 20 union all select 2 ,'loc2' , 20 ,null ,10 , 10 ) SELECT * FROM ( select id, loc, val1 as val from t a UNION ALL select id, loc, val2 as val from t a UNION ALL select id, loc, val3 as val from t a UNION ALL select id, loc, val4 as val from t a ) x order by ID
run
|
edit
|
history
|
help
0
array comparison
Select rows with no intersection on join table and check by date
Q2
Comp
test
test jsonb_set of PostgreSQL
Select all countries that can be found by recursively adding all neighbouring countries (PostgreSQL)
nasa2
SQL social network practice by Han Wang 20200720 - 2
PostgreSQL: Inner Join