Created
May 13, 2016 10:29
-
-
Save isogram/c5fd87ec447c32ca73d3a32c6e47beb2 to your computer and use it in GitHub Desktop.
Get Date Range From Week Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
STR_TO_DATE(concat(tgl, ' Monday'),'%x%v %W') date_start, | |
STR_TO_DATE(concat(tgl, ' Sunday'),'%x%v %W') date_end | |
from | |
( | |
select | |
date_format(updated_at, "%Y%v") as tgl, | |
count(1) as counter | |
from table | |
group by tgl | |
) as c; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment