SELECT CASE numeric_field
WHEN 100 THEN 'some string'
WHEN 200 THEN 'some other string'
ELSE numeric_field::text
END AS result
- Your statement was incomplete,
END
was missing. Read the manual here. To output a numeric field as text, just cast it to text:
numeric_field::text
, which is the Postgres specific short form of the SQL standard call:cast (numeric_field AS text)