If I have this table:
+----+--------+--------+--------+--------+
| ID | Field1 | Field2 | Field3 | Field4 |
+----+--------+--------+--------+--------+
| 1 | Foo | | Bar | Baz |
| 2 | | Baz | | |
| 3 | | Dolor | Bob | |
| 4 | Lorem | | | Test |
| 5 | | Ipsum | | |
| 6 | Foo | Bar | Baz | Test |
+----+--------+--------+--------+--------+
How can I select a single row, and have the non-null columns returned as a list?
For example, if I have this (incomplete) statement: SELECT [...] AS Columns FROM [MyTable] WHERE ID = 1
, I would like to see this as the result:
+---------+
| Columns |
+---------+
| Foo |
| Bar |
| Baz |
+---------+
How would this select statement look?