当前位置: 代码迷 >> Sql Server >> select count(*)如何和其他select语句写在一起
  详细解决方案

select count(*)如何和其他select语句写在一起

热度:14   发布时间:2016-04-27 16:18:05.0
select count(*)怎么和其他select语句写在一起?
我需要在多连接多线程下使用数据库,
select   count(*)   from   table   ;得到结果集的行数

select   *   from   table  
得到的最终结果数量是不是有可能不一致?
我需要select   *   from   table   执行后得到结果集的行数好分配内存存放结果集,能不能2句写成一个复合语句?

------解决方案--------------------
select *,count=(select count(*) from table ) from table
  相关解决方案