我们知道:
select 1
会返回一个1行1列的结果集,其值为1
(执行结果 “消息”为:1行受影响)我想有没有一条简单的sql语句,不需要查询任何表的,结果集为:1
2
3
4
(执行结果 “消息”为:4行受影响)谢谢。
select 1
会返回一个1行1列的结果集,其值为1
(执行结果 “消息”为:1行受影响)我想有没有一条简单的sql语句,不需要查询任何表的,结果集为:1
2
3
4
(执行结果 “消息”为:4行受影响)谢谢。
union all
select 2
union all
select 3
union all
select 4
union all
select 2
union all
select 3
union all
select 4
select * from master..spt_values where number between 1 and 4 and type='u'
select number from master..spt_values where number between 1 and 4 and type='p'
select * from
(
values
(1),(2),(3),(4)
) as t1(id)-------------------
id
1
2
3
4
;with t as(
select 1 as dt
union all
select dt+1 from t
where dt+1<=100
) select dt from t option(maxrecursion 0)