filter data according to months

Viewed 170

I'm building query which filter data according to months using created_at column, my current query

Query:

SELECT id, title, body, created_at, from posts ORDER BY id DESC

Now when created_at column prints it shows following result 2020-03-01 07:50:07 but i want to print month name like March,April how it should be achieved

Thanks

2 Answers

Query:

SELECT id, title, body, MONTHNAME(created_at) from posts  ORDER BY id DESC

replace created_at with MONTHNAME(created_at)

MONTHNAME(col_name) function will display month name

Related