MYSQL select records for a specific day from date column

I have a table in mysql with a day column with type DATE.
I need to select all the records for Monday. Is there any way to filter records by putting
the day condition on date column. e.g.

select * from mytable where day = SomeTranslationFunction('Sunday');


select * from mytable where day = SomeTranslationFunction('Sunday');

Open in new window

SimonHowaldAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
lwadwellConnect With a Mentor Commented:
Hi SimonHowald,

try ...

select * from mytable where dayofweek(day) = 2;

the dayofweek() function returns the day of the week as 1 = Sunday, 2 = Monday ...

You could also use the dayname() function.


lwadwell
0
 
khr2003Commented:
hi
I do not think there is a problem in adding a function to the query, however you must take into account the output of that function. So you have to be aware of the function you are using.

regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.