Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
ee4aa302
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ee4aa302
编写于
11月 28, 2005
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve documentation for COALESCE and NULLIF. Add references for NVL
and IFNULL. Backpatch to 8.1.X.
上级
20054503
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
11 deletion
+23
-11
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+23
-11
未找到文件。
doc/src/sgml/func.sgml
浏览文件 @
ee4aa302
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.29
5 2005/11/19 19:44:54 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.29
6 2005/11/28 23:18:48 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -7227,6 +7227,14 @@ SELECT ... WHERE CASE WHEN x <> 0 THEN y/x > 1.5 ELSE false END;
<primary>COALESCE</primary>
</indexterm>
<indexterm>
<primary>NVL</primary>
</indexterm>
<indexterm>
<primary>IFNULL</primary>
</indexterm>
<synopsis>
<function>COALESCE</function>(<replaceable>value</replaceable> <optional>, ...</optional>)
</synopsis>
...
...
@@ -7234,9 +7242,8 @@ SELECT ... WHERE CASE WHEN x <> 0 THEN y/x > 1.5 ELSE false END;
<para>
The <function>COALESCE</function> function returns the first of its
arguments that is not null. Null is returned only if all arguments
are null. This is often useful to substitute a
default value for null values when data is retrieved for display,
for example:
are null. It is often used to substitute a default value for
null values when data is retrieved for display, for example:
<programlisting>
SELECT COALESCE(description, short_description, '(none)') ...
</programlisting>
...
...
@@ -7246,7 +7253,9 @@ SELECT COALESCE(description, short_description, '(none)') ...
Like a <token>CASE</token> expression, <function>COALESCE</function> will
not evaluate arguments that are not needed to determine the result;
that is, arguments to the right of the first non-null argument are
not evaluated.
not evaluated. This SQL-standard function provides capabilities similar
to <function>NVL</> and <function>IFNULL</>, which are used in some other
database systems.
</para>
</sect2>
...
...
@@ -7262,16 +7271,19 @@ SELECT COALESCE(description, short_description, '(none)') ...
</synopsis>
<para>
The <function>NULLIF</function> function returns a null value if and only
if <replaceable>value1</replaceable> and
<replaceable>value2</replaceable> are equal. Otherwise it returns
<replaceable>value1</replaceable>. This can be used to perform the
inverse operation of the <function>COALESCE</function> example
given above:
The <function>NULLIF</function> function returns a null value if
<replaceable>value1</replaceable> and <replaceable>value2</replaceable>
are equal; otherwise it returns <replaceable>value1</replaceable>.
This can be used to perform the inverse operation of the
<function>COALESCE</function> example given above:
<programlisting>
SELECT NULLIF(value, '(none)') ...
</programlisting>
</para>
<para>
If <replaceable>value1</replaceable> is <literal>(none)</>, return a null,
otherwise return <replaceable>value1</replaceable>.
</para>
</sect2>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录