示例
-- 按月分组
DATE_FORMAT(now(),'%Y-%m')
参考
MySQL 中的 DATE_FORMAT() 函数%20function%20in%20MySQL%20is%20used%20to%20format%20a,date%20as%20specified%20format%20parameters.&text=Parameter%20%3A%20This%20function%20accepts%20two,format%20%E2%80%93%20Specified%20format.)