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.
1条答案
按热度按时间vlju58qv1#
or
or (for SQL Server 2022+ and Azure SQL)