Function
DATE_FORMAT
returns formatted version of the datetime string passed as the first parameter
SELECT 
    DATE_FORMAT('2022-03-25 18:24:14', '%Y-%m-%d %H:%i:%s')
In this example we only need to get month and day with underscore between the values
SELECT 
    DATE_FORMAT('2022-03-25 18:24:14', '%m_%d')
by Valeri Tandilashvili
4 years ago
MySQL
Datetime functions
Full MySQL Course for Beginners
1
Pro tip: use ```triple backticks around text``` to write in code fences