Skip to content
Advertisement

How to extract year and month from date in PostgreSQL without using to_char() function?

I want to select sql: SELECT "year-month" from table group by "year-month" AND order by date, where year-month – format for date “1978-01″,”1923-12”. select to_char of couse work, but not “right” order:

Advertisement

Answer

e.g.

http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement