I have a table with a column month(integer). In this column I store values like 1, 2, .. 12.
But I have to show the month name.
Ex:
If the value is 1 I need to display jan.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically what @small_duck already posted, but a couple of improvements:
A plain cast to text
4::textis enough, no need forto_char(..).Question asks for lower case “jan”, there is a template pattern for that:
mon.If you want to localize the output, prefix the template with the modifier
TM.