A simple understanding of coalesce functions in Oracle

Source: Internet
Author: User
A simple understanding of the coalesce function in Oracle 2008-01-1814: 23: 48 classification of individuals: Oracle Database Technology-SQL view (288) Comments (0) score (00) during the test today, I found an SQL: deletefromTS_LOCKSwhereCOALESCE (FLPLNCMPNTID, 0): 1 andCOALESCE (FLPLN

A simple understanding of the coalesce function in Oracle/14:23:48/personal classification: Oracle Database Technology-SQL view (288)/comments (0)/scores (0/0) today during the test, an SQL statement is found: delete from TS_LOCKS where COALESCE (FLPLNCMPNTID, 0) =: 1 and COALESCE (FLPLN

A simple understanding of coalesce functions in Oracle

/14:23:48/person type: Oracle Database Technology-SQL

View (288)/comment (0)/score (0/0)

We are doing this todayTestWhen I foundSQL:
Delete from TS_LOCKS whereCOALESCE(FLPLNCMPNTID, 0) =: 1 andCOALESCE(FLPLNCMPNTPARTID, 0) =: 2

The coalesce function is used, so what is the use of this function?
To explain:

COALESCE (a, B, c, d... z)
Returns the first non-null value in the parameter table (starting from left)
That is to say, if a is not null, a is returned. If a is null, B is judged, and so on.
A, B, c, d... z can be a field, or the return value of another function or the result value of an expression.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.