filter data according to months

Ali Raza :

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

Faizan Sadiq :

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=25546&siteId=1