Skip to content
Advertisement

Order By Month Name – Postgresql

I followed this post Order by using month name in PostgreSQL but not success!

I have a query (its working) and I just need to order the results by mont name. This is thr query I am using:

I am trying:

If i use order by mes_2021

enter image description here

Advertisement

Answer

One trick is to use a window function on the date:

This, of course, assumes that the dates are all in the same year. But your where clause is taking care of that.

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