How to select more than one value from a 'non-existing' table.
For example:
SELECT ('val1', 'val2') as "test"
How to make a column "test" with two values/rows val1 and val2?
CodePudding user response:
you can use union
two rows in table like below code:
select 'val1' as "test"
union
select 'val2' as "test"
CodePudding user response:
If you use SQL Server family, you can use a query similar to this:
declare @tmpTable as table (test varchar(50))
insert into @tmpTable
select 'val' Go 100
now you can use @tmpTable