在查询结果中添加一列表示记录的行数的sql语句
程序员文章站
2022-06-20 09:29:51
复制代码 代码如下:declare @table table ([values] varchar(10)) &...
复制代码 代码如下:
declare @table table ([values] varchar(10))
insert into @table select 'aaa'
union all select 'ccc'
union all select 'eee'
union all select 'ddd'
union all select 'bbb'
select [rowid] = identity (int, 1, 1), * into # from @table
select * from #
drop table #