fer*_*vak 2 sql t-sql select count
我有超过30万行,即使我使用TOP*语句只选择20/50/100记录,我想返回记录的总数.
是否可以过滤选择之类的
select top 50 * from table where rule1=rule1 and rule=rule2
假设数据库为300 000并且上面选择的记录总数将返回4 000条记录.但实际上它只返回50条记录,我需要知道manu是如何在数据库中使用这个where语句(它将返回4000).
where
谢谢
Mik*_*son 8
select top 50 *, count(*) over() from table where rule1=rule1 and rule=rule2
归档时间:
14 年,6 月 前
查看次数:
5028 次
最近记录: