mysql

查询当天的前5条数据 

select  * from tb_orderitem  where date(itemTime)=curdate()   order by amount desc limit 5 

查询当天的总销售额

select year(ordertime) as yearDB ,month(ordertime) as monthDB ,day(ordertime) dayDB,sum(total) as total  from tb_order group by year(ordertime),month(ordertime),day(ordertime)

posted @ 2018-05-05 16:37  半生少年  阅读(77)  评论(0编辑  收藏  举报