The only way (I’m fairly sure) to do this is using a CASE .. WHEN ...
construct:
SELECT *, CASE type WHEN 1 THEN 'abc' WHEN 2 THEN 'xyz' END as stringType
FROM orders
You can also use the ELSE
clause to specify a default, e.g. CASE type WHEN 1 THEN 'abc' WHEN 2 THEN 'xyz' ELSE 'unknown' END
.