I am performing a SQL query in Postgres, which selects a numeric field. I need to display a string value as the result of this SELECT, so I am using a CASE statement like this:
Select 
case numeric_field
when 100 then 'some string'
when 200 then 'some other string'
The problem is that if the numeric field has any other value (like 300 for example), I need to display this value (as a string of course). I try to put a CONVERT on the else like this
...
else CONVERT(varchar(10),numeric_field)
But it didn't work. How do I do this?
 
     
    