I am trying to query MySQL database all the record where date is on Monday or Tuesday like query would be
select count(*) from table where date = Monday;
what would be best way to execute that query in mysql workbench
thanks
Try function weekday:
select count(*) from table where weekday(date) = 0;
And see official doc here.
As @Psi said, if you will concern performance, you should avoid function, and you'd better create a new column to store weeday.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With