首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

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

2012-02-23 
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

热点排行