skytf=> /d test_41; Table"skytf.test_41" Column | Type | Modifiers --------+-----------------------+----------- id | integer | name | character varying(32) | skytf=> select * from test_41; id | name ----+------ 1 | a 2 | b 3 | c (3 rows)
skytf=> select a.name, skytf-> case when a.id=1then 'one' skytf-> when a.id=2then 'two' skytf-> else 'other' skytf-> end skytf-> from test_41 a ; name | case ------+------- a | one b | two c | other (3 rows)