1、 对update,delete也有效
...
select @@rowcount as 行数
2、 只能select语句
select count(*) as 行数 from (
...
) as t
...
select @@rowcount as 行数
2、 只能select语句
select count(*) as 行数 from (
...
) as t
调试欢乐多
select count(*) as '行数' from tbladmin
结果:
行数
-----------
2
raiserror('%d',16,1,@@rowcount)
结果:
1
有没有类似select count(select * from aa)这样的语句可以进行统计??
select count(select f1,f2 from bb where f1='ff')
select count(*) from (你的select语句) a
最后的a是什么意思?为什么我替换为任意的串都可以??
另:select count(select * from a)
select count(select f1,f2 from bb where f1='ff')
都无法通过编译。
最后的a是 別名