Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
conditionally add “another row” in SQL Server?
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
SELECT CASE WHEN arg = '1' THEN unnest(ARRAY[my_row,'another row']) ELSE my_row END FROM ( SELECT 0 arg, 'apples' my_row UNION ALL SELECT 0 arg, 'oranges' my_row UNION ALL SELECT 1 arg, 'pears' my_row UNION ALL SELECT 0 arg, 'dates' my_row ) t
absolute service time: 0,44 sec
edit mode
|
history
|
discussion
my_row
1
apples
2
oranges
3
pears
4
another row
5
dates