现在我知道如何选择表中一列的输出
select column1, column2 into #temptable
现在,如果我只想自己将值输入表中怎么办?
我知道
select 'a' [column1] into #temptable
作品
和
select 'a' [column1] into #temptable
union
select 'b' [column1]
也可以
但是可以肯定的是,在SQL中将多行文本排成一行的想法比较简单。
您可能需要所需的表
select v.value
into #temptable
from (
values ('a'), ('b'), ('c')
)v(value);
要么
select 'a' as Value
into #temptable2
insert into #temptable2
values ('b'), ('c')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句