If I have dates Column and i want to select dates of monday and sunday only from past 1 year, how can i do it with effective code in SQL
I tried to select manually the dates but its very long process so can i get a proper method for the same
If I have dates Column and i want to select dates of monday and sunday only from past 1 year, how can i do it with effective code in SQL
I tried to select manually the dates but its very long process so can i get a proper method for the same
3
Answers
How about a combination of date range checking and
DAYOFWEEK()
?You can select dates that fall on Mondays and Sundays from the past year in MySQL using a query with the
DATE
andDAYOFWEEK
functions.