MySQL Get Month Short Name from Date Example
Hi Friends,
I am going to explain you example of MySQL get month short name from date example. You will learn How to get the short month name from a date in MySQL?. DATE_FORMAT '%b' for short month name in SQL query.
In MySQL, you can use the DATE_FORMAT() function with the %b format specifier to return the short month name. For example, you can return Jan or Feb instead of January or February.
You can use from MySQL to display Month short name from date. I will give you simple query to getting data get the short month name from table.
Let's see example here:
Table : users
Solution SQL Query:
SELECT
*,
DATE_FORMAT(created_at, '%b') as month_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