Home > Database > Mysql Tutorial > Oracle中coalesce函数的简单理解

Oracle中coalesce函数的简单理解

WBOY
Release: 2016-06-07 15:45:30
Original
1763 people have browsed it

Oracle中coalesce函数的简单理解 / 2008-01-18 14:23:48/ 个人分类:Oracle数据库技术-SQL 查看( 288 ) /评论( 0 ) / 评分( 0 / 0 ) 今天在做 测试 的时候,发现了一条 SQL : delete from TS_LOCKS where COALESCE (FLPLNCMPNTID, 0)=:1 and COALESCE (FLPLN

Oracle中coalesce函数的简单理解

/  2008-01-18 14:23:48/ 个人分类:Oracle数据库技术-SQL

查看( 288 ) / 评论( 0 ) / 评分( 0 / 0 )

今天在做测试的时候,发现了一条SQL:
delete from TS_LOCKS whereCOALESCE(FLPLNCMPNTID, 0)=:1 andCOALESCE(FLPLNCMPNTPARTID, 0)=:2

其中用到了coalesce函数,那么这个函数的是干什么用的呢?
来解释一下:

COALESCE(a,b,c,d.....z)
返回参数表中第一个不为null的值(从左开始)
也就是说如果a is not null就返回a,如果a为null,再判断b,以此类推
a,b,c,d.....z 可以是字段,也可以是其他函数的返回值或者表达式的结果值

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template