在查询结果中添加一列表示记录的行数的sql语句

复制代码 代码如下:

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 #   

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐