Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SQL - Unpivot Table
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
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
absolute service time: 0,97 sec
edit mode
|
history
|
discussion