Reputation: 463
Here is my query SELECT EXTRACT(YEAR_MONTH FROM <date>) FROM <table>;
SELECT EXTRACT(YEAR_MONTH FROM <date>) FROM <table>;
Output of this query is 201309
But how to get it like Sep-2013 , and that too as a date?
Upvotes: 1
Views: 60
Reputation: 204746
SELECT date_format(curdate(), '%b-%Y')
DATEFORMAT()
Upvotes: 3
Reputation: 37045
SELECT CONCAT(MONTHNME(<date>), "-", YEAR(<date>) FROM <table>;
Upvotes: 2