原sql语句: -- 累计授权 select concat(substr(a.create_time,1,4),substr(a.create_time,6,2)) ny, count(distinct a.account) sq, 0 jh from dwd_it_user_role_menu_detail_c a group by concat(substr(a.create_time,1,4),substr(a.create_time,6,2)) 错误, 调整为: -- 累计授权 select concat(substr(a.create_time,1,4),substr(a.create_time,6,2)) ny, count(distinct a.account) sq, 0 jh from dwd_it_user_role_menu_detail_c a group by a.create_time 就执行成功,但是不是我想要的结果,我想要的是group by 年月格式,而不是年月日格式 |