select * from
(Select * from equip where .....) a,
(Select count(ID) as allcount from equip where .....) borSelect *,
(select count(ID) from equip where .....) as allcount 
from equip where .....

解决方案 »

  1.   

    select (select count(*) from equip where ... )as allcount , * from  equip where .......
      

  2.   

    sky_blue(老衲)后面的语句是对的
      

  3.   

    如果有唯一键,就可以利用GROUP 子句select count(*), * from table where ... group by cube(唯一键)他会在最后一条记录表示出记录数。
      

  4.   

    恩,sky_blue(老衲)的解法是正确的,按照题目要求
    select (select count(*) from equip where 条件1... )as allcount , * from  equip where 条件1.......
    两个where中的条件应该一致!