create_time时间格式
SELECT DATE_FORMAT(create_time,'%Y%u') weeks FROM student GROUP BY weeks;
SELECT DATE_FORMAT(create_time,'%Y%m%d') days FROM student GROUP BY days;
SELECT DATE_FORMAT(create_time,'%Y%m') months FROM student GROUP BY months
create_time时间戳格式
SELECT FROM_UNIXTIME(create_time,'%Y%u') weeks FROM student GROUP BY weeks;
SELECT FROM_UNIXTIME(create_time,'%Y%m%d') days FROM student GROUP BY days;
SELECT FROM_UNIXTIME(create_time,'%Y%m') months FROM student GROUP BY months
原文链接:https://blog.csdn.net/qq502948261/article/details/89969014
网友评论