23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

COALESCE<br />

Syntax<br />

COALESCE<br />

• The CHR and CHAR functions are character-set dependent, and support multi-byte<br />

characters. If integer_expression is a valid character encoding integer value in the<br />

current <strong>SQL</strong> server character set, the function returns the correct character. If it is not a<br />

valid character the function returns a NULL value.<br />

Compatibility<br />

Progress extension<br />

Specifies a series of expressions and returns the first expression whose value is not NULL. If all<br />

the expressions evaluate as null, COALESCE returns a NULL value.<br />

The COALESCE syntax is shorthand notation for a common case that can also be represented in a<br />

CASE expression. The following two formulations are equivalent:<br />

Example This example illustrates the COALESCE function:<br />

Notes • This function is not allowed in a GROUP BY clause.<br />

CONCAT<br />

COALESCE ( expression1, expression2 [... ] )<br />

COALESCE ( expression1 , expression2 , expression3 )<br />

CASE<br />

WHEN expression1 IS NOT NULL THEN expression1<br />

WHEN expression2 IS NOT NULL THEN expression2<br />

ELSE expression3<br />

END<br />

SELECT COALESCE (end_date, start_date) from job_hist;<br />

• Arguments to this function cannot be query expressions.<br />

Compatibility<br />

<strong>SQL</strong> compatible<br />

Returns a concatenated character string formed by concatenating two arguments.<br />

85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!