先使用group by 把时间做以一个分组,查询出每天的最大值,再用order by desc降序排序,
select max(price), ordertime from time1 GROUP BY ordertime ORDER BY ordertime DESC LIMIT 1
先使用group by 把时间做以一个分组,查询出每天的最大值,再用order by desc降序排序,
select max(price), ordertime from time1 GROUP BY ordertime ORDER BY ordertime DESC LIMIT 1
本文标题:查询最后一天的最大值
本文链接:https://www.haomeiwen.com/subject/ifyzjftx.html
网友评论