MySQL Get Day Short Name From Date Example
Hi Friends,
I am going to explain you example of mysql get day short name from date example. You will learn How to get the short day name from a date in MySQL?. DATE_FORMAT '%a' for short day name in SQL query.
In MySQL, you can use the DATE_FORMAT() function with the %a format specifier to return the short day name. For example, you can return Sun or Mon instead of Sunday or Monday.
You can use from MySQL to display day short name from date. I will give you simple query to getting data get the short day name from table.
Let's see example here:
Table : users
Solution SQL Query:
SELECT
*,
DATE_FORMAT(created_at, '%a') as day_name
FROM `users`
Output:
I hope it will help you...
- How to Increase max_connections in MySQL?
- How to Install the PHP PDO MySQL Extension on Ubuntu 22.04?
- How to Install PHP MySQL on Linux Ubuntu?
- How to Install LEMP Stack Nginx, MySQL, PHP on Ubuntu?
- How to Change MySQL Root User Password Ubuntu?
- PHP 8 MySQL Form Validation Example
- How to Select First Row Only in PHP MySQL?
- How To Backup MySQL Database Using PHP Example