devxlogo

Understanding the DAYOFWEEK Function in MySQL

Understanding the DAYOFWEEK Function in MySQL

You can easily find the day of the week for a given date in MySQL. The day starts with 1 (Sunday), 2 (Monday) and so on.

Command:

SELECT DAYOFWEEK('2018-02-20');

Expected output:

+-------------+|DAY OF WEEK  |+-------------+|          3  |+-------------+

devx-admin

Share the Post: