In SQL, if I want to select a hardcoded value, I can do SELECT 1; for example, which would return a table with one column and one row with value 1.
How can I select the hardcoded array in SQL?
So, I want the output to contain one column with two rows, say with values 1 and 2. How can I do that?
I tried SELECT 1, 2; but that returns a table with one row but two columns, what I do not want. I also tried SELECT (1, 2); and SELECT IN(1, 2); but none of them works.
I use the Microsoft Structured Query Language server.
SELECT 1 UNION ALL SELECT 2, but what's the purpose of that strange idea?GENERATE_SERIES. In any version using a hard coded list of values is rather cumbersome and strange.TABLE VALUE CONSTRUCTOR?SELECT a,b FROM (VALUES (1,2)) a (a,b)learn.microsoft.com/en-us/sql/t-sql/queries/…