| id |
+----+
| 1 |
| 2 |
| 4 |
| 5 |
+----+
Output as row
1 2 4 5
Without use of Pivot method ,no hardcoding like checking with case with when 1 = 1.No dynamic Sql .with out any inbuilt function.
I have searched questions but could not find anything in pure sql Is there a way?