I was just wondering if there is something in postgres which allows me to custom sort some string columns. Let me explain what i mean.
Suppose if there is a column named semester...which can contain legal values like spring, fall, and summer.
Now if i want to sort this column in order fall, summer, spring.
I know there can be many alternatives for this approach...
But Is this possible ???
Add a lookup table to your database, holding a semester name, and a semester sort value (0-N)
Join the tables in your queries, and sort by the sort value.
Personally, I would probably put the numeric value in the base table, and add the text value in the lookup table. Then, join the description to the base table in the queries or Views.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert