额,不知道标题是否合理,情况是这样的,我想实现一个类似滑动订单的查询,就是查看每分钟一共收到了多少请求。该表比较大
select count(*) from gwserverperfdatas;
'15636855'
我想只查询其中一部分
CREATE View tmpGw as select * from gwserverperfdatas where OccurTime>=utc_date();
select time(a.OccurTime) as endtime,
time (b.OccurTime) as beginTime,
max(c.RecvReqCount)-min(c.RecvReqCount)
from tmpGw a
inner join tmpGw b
on date_add(a.OccurTime, INTERVAL 1 MINUTE) = b.OccurTime
inner join tmpGw c
on c.OccurTime between a.OccurTime and b.OccurTime
group by a.OccurTime,b.OccurTime
不过不管是使用临时表还是使用视图都会提示如下错误:
13:08:24 select time(a.OccurTime) as endtime, time (b.OccurTime) as beginTime, max(c.RecvReqCount)-min(c.RecvReqCount) from tmpGw a inner join tmpGw b on date_add(a.OccurTime, INTERVAL 1 MINUTE) = b.OccurTime inner join tmpGw c on c.OccurTim