如何用SQL语句统计出我查询出的数据的行数?

来源:百度知道 编辑:UC知道 时间:2024/06/03 17:51:47
例如:
select date,aaa,bbb,sum(money) from goods
where date='2006/12/09'
group by date,aaa,bbb
having sum(money)>=68.00 and sum(money)<=128.00
order by sum(money);
我想统计出用这个语句查询出的数据的总行数是多少,
能不能用count()来实现?或者用别的方法来实现?

我是个SQL语句的初学者,还请各位朋友多多帮忙,多谢!

你这个例如,好像毛病不少,都选定日期where date='2006/12/09' 了,怎么还要按日期分组呢group by date?其实在select后加入count(*),就是统计元组个数。

.recordcount可以不?