获取指定时间内的周数

SELECT
WEEK (
DATE_FORMAT(
date_add(
DATE_FORMAT(
DATE_ADD(NOW(), INTERVAL - 3 MONTH),
'%Y-%m-%d'
),
INTERVAL (
cast(
help_topic_id AS signed INTEGER
)
) DAY
),
'%Y-%m-%d'
)
) weekInfo
FROM
mysql.help_topic
WHERE
help_topic_id < datediff(
DATE_FORMAT(CURDATE(), '%Y-%m-%d'),
DATE_FORMAT(
DATE_ADD(NOW(), INTERVAL - 3 MONTH),
'%Y-%m-%d'
)
) + 1

GROUP BY weekInfo

上一篇:Java 注解


下一篇:@RestController和@Controller