我有一个包含日期,小时,分钟和不同对象列的表。我试图求和(col x)并在小时级别聚合它以减少行数。
select count(*) from table where date=xxxx
将获取19022640行,所以如果我尝试
select count(*) from table where date=xxxx
和
select sum(col x) from table group by date,hour
这似乎不起作用。请帮忙。
答案 0 :(得分:0)
select date,hour, sum(col x) from table group by date,hour