Postgresql有没有判断语句呀?该如何解决

Postgresql有没有判断语句呀?Postgresql有没有判断语句呀?[解决办法]The example above can be written us

Postgresql有没有判断语句呀?
Postgresql有没有判断语句呀?

[解决办法]
The example above can be written using the simple CASE syntax:

SELECT a,
CASE a WHEN 1 THEN 'one '
WHEN 2 THEN 'two '
ELSE 'other '
END
FROM test;

a | case
---+-------
1 | one
2 | two
3 | other