Marc
Marc

Reputation: 601

get month name from timestamp column postgresql

I wanna get the number of loans per month but I can't find a way to change the timestamp to month name, I get an error every time...

Here is the table enter image description here

Upvotes: 4

Views: 1696

Answers (1)

Blue Star
Blue Star

Reputation: 1952

If you're looking for the English name of the month, you can get it from your timestamp using to_char:

SELECT to_char(created, 'Month')

This is what it looks like for today:

SELECT to_char(now(), 'Month') as month;
   month
-----------
 March
(1 row)

Upvotes: 5

Related Questions