碰到这样一个需求,需要查出订单表中每个时段的销量,请问sql中如何根据时段去分组?数据库为mysql
select date_format(now(),'%h') as house_group;
你运行下这个函数你就懂了
关于 DATE_FORMAT()的语法 下面有 http://www.w3school.com.cn/sq...
2.1m questions
2.1m answers
60 comments
56.7k users