Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
cpana
/* wanted result: a | b | c | d | e ---+---------------+---------+------------------+--------------------- 1 | abc | {a,b,c} | 2019-03-19 23:00 | 2 | def | {1,2,3} | | 4 | {a,b,c,d,e,f} | Ac | 2019-03-19 23:00 | 2019-03-19 19:00:00 3 | | 13 | | no data (4 rows) obviously avoiding manipulations with letters and numbers - structing from given data only no a+1 to get 2 and 3, or select '{a,b,c,d,e,f}' to get b column third line please */ with c as (values (1,'abc','{a,b,c}','2019-03-19 23:00','') , (2, 'def','{1,2,3}','','') , (4,'{abcdef}','Ac','2019-03-19 23:00','2019-03-19 19:00:00') , (3,'','13','','no data' ) ) select c.column1 as a, c.column2 as b, c.column3 as c, c.column4 as d, c.column5 as e from c;
run
|
edit
|
history
|
help
0
Pedido_Insert_Delete
Pivot the Hard Way.
Projeto
loggin_trigger-audit
PosgresSQL Sandbox: Legitimate Resale
SQL social network practice by Han Wang 20200720 - 2
user
Return IDs where there are exactly 3 occurrences1
postgresql timestamp
OLA