先按某字段分组再取每组中前 N 条记录
1 | SELECT show_date,photo_url,video_url FROM tb_grouth_album a |
取日期字段的年月日
SELECT DATE_FORMAT(crt_time,'%Y-%m-%d') FROM ad_n_advertise_t
订单按照月份分类统计总数
SELECT count(1),DATE_FORMAT(create_time,"%Y-%m") month FROM integral_charge_order GROUP BY month;