I need to create a table with a column named as "months" in postgresql."Month" column should have January, February,etc not as 1, 2,3, etc. And I need to retrieve data ordered by months. what is the datatype I should used and how can I retrieve data ordered by month?
If you only need to save months, and not entire dates, I'd create an enum:
CREATE TYPE month_enum AS ENUM
('January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With