I tried fetching date from table using date(column_name) which gives output:
2018-03-13
But is there a way to get the same result in the format
2018, 03, 13
You Can Use
SELECT REPLACE(col_Name,'-',', ') FROM table_Name;
Or
SELECT DATE_FORMAT(col_Name, '%Y, %m, %d') FROM table_Name;
Example
SELECT REPLACE('2018-03-13','-',', ')
Output
2018, 03, 13
Live Demo
Use DATE_FORMAT
method provided by mysql.
SELECT DATE_FORMAT("2018-03-13", "%Y, %m, %d");
Result:
2018, 03, 13
There is.
SELECT DATE_FORMAT("2018-03-13", "%Y, %m, %d");
Source: https://www.w3schools.com/sql/func_mysql_date_format.asp