Saturday, April 15, 2017

Laravel 5.3: Best way to retrieve data between dates and group them in weeks?

Hey guys I need some SQL advice here... Lets say I have 1000 rows of data from the past 8 weeks. Each row has a DATETIME field and I want to pull the last 3 weeks, group the data by week 1, week 2 and week 3. What is the best way to achieve this?

Thanks!



via J.Koppen

Advertisement