SELECT concat(year,lpad(month,2,0),lpad(day,2,0)) as mydate,week(concat(year,lpad(month,2,0),lpad(day,2,0)) ,3) as myweek FROM t_status WHERE concat(year,lpad(month,2,0),lpad(day,2,0)) >=20050606 GROUP BY myweek ORDER BY mydate DESC
当db中记录跨年时,使用week group by 应改成yearweek
SELECT concat(year,lpad(month,2,0),lpad(day,2,0)) as mydate,yearweek(concat(year,lpad(month,2,0),lpad(day,2,0)) ,3) as myweek FROM t_status WHERE concat(year,lpad(month,2,0),lpad(day,2,0)) >=20050606 GROUP BY myweek ORDER BY mydate DESC
No Responses (yet)
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.