如何用一条SQL语句来获得表equip中的符合条件的记录集以及统计出所含记录条数

如题,
可以如下吗:
Select *,count(ID) as allcount from equip where .....
---------------------------------------------------------------

正确回答:

select (select count(*) from equip where 条件1... )as allcount , * from equip where 条件1.......
两个where中的条件应该一致!

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus