有谁能给出个好点的SQL语句或存储过程么?

数据 库是MYSQL5的,数据的表结构如下:

create table t_visitonline
(
   id                   bigint(20) not null auto_increment,
   online               int(11) comment '在线人数',
   counter              int(11) comment '累计访问量',
   loginer              int(11) comment '在线登录人数',
   recordtime           datetime not null comment '记录时间',
   primary key (id)
);


alter table t_visitonline comment '访问量统计';


/*==============================================================*/
/* Index: Index_real_visitonline_date_1                         */
/*==============================================================*/
create index Index_t_visitonline_date_1 on t_visitonline
(
   recordtime
);

数据记录如下图示: 


现在我要按某一段时间内来统计查出online、counter、loginer的最大数,这个时间段有可能是一个月的每一天,有可能是某一天的每一个小时,也就是说,每一天里查出online、counter、loginer的最大数,或者每一个小时里查出online、counter、loginer的最大数,分别显示,有谁能给出个好点的SQL语句或存储过程么?

在这也有提问《有谁能给出个好点的SQL语句或存储过程么?》,先谢谢大家的帮助。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值