您想要将转换
stat_time为一天来执行此操作。该方法取决于数据库。这是一种方法:
SELECt cast(stat_time as date) as stat_day, SUM(reads), SUM(writes)from this_tableGROUP BY cast(stat_time as date)order by stat_day;
以下是一些其他方法(适用于MySQL和Oracle):
SELECt date(stat_time) as stat_day, SUM(reads), SUM(writes)from this_tableGROUP BY date(stat_time)order by stat_day;SELECt trunc(stat_time) as stat_day, SUM(reads), SUM(writes)from this_tableGROUP BY trunc(stat_time)order by stat_day;



