select date_format(
date_add(
cast(
concat(year(current_date),‘-01-01‘)
as date),
interval t500.id-1 day),
‘%W%) day,
count(*)
from t500
where t500.id<=datediff(
cast(
concat(year(current_date)+1,‘-01-01‘)
as date),
cast(
concat(year(current_date),‘-01-01‘)
as date))
group by date_format(
date_add(
cast(
concat(year(current_date),‘-01-01‘)
as date),
interval t500.id-1 day),
‘%W%)
时间: 2024-10-12 10:43:38