Is Coalesce a function of ANSI SQL
Asked Answered
M

3

13

Is the COALESCE a function of the ANSI SQL especification? Is it supported by the major relational databases?

Multicolor answered 25/7, 2018 at 15:26 Comment(4)
One caveat, just because a function is an ANSI SQL standard, doesn't mean that most RDBMS's support it. For instance temporal logic is an ANSI SQL:2011 SQL standard and there's only a few databases that are supporting it so far (although many are catching up or have similar-ish or partial temporal functionality). COALESCE() is everywhere though and a standard (92, I think).Agc
@Agc Good point, and as an example of that, COALESCE() is not available in MS AccessStricklan
COALESCE() is ISO/ANSI standard SQL. It is available in almost all databases (all if you don't include MS Access).Rubric
Whenever a DBMS supports CASE it also supports COALESCE and NULLIF, both are shortcuts.Victory
L
7

Yes:

https://www.mssqltips.com/sqlservertip/2689/deciding-between-coalesce-and-isnull-in-sql-server/

From the article:

Some think that you need to use COALESCE because it is the only one that adheres to the ANSI SQL standard.

and Yes.

Lecture answered 25/7, 2018 at 15:28 Comment(0)
S
6

The ISO/ANSI SQL standard specification ISO/IEC 9075-2:2023(E), Annex H, SQL mandatory feature taxonomy, lists CASE and COALESCE as mandatory features:

F261     CASE expression
F261-04  COALESCE

COALESCE is also an ISO/ANSI SQL reserved word (https://en.wikipedia.org/wiki/List_of_SQL_reserved_words)

Stepheniestephens answered 20/12, 2019 at 9:3 Comment(0)
S
0

Yes, COALESCE is defined by the ISO/ANSI SQL standards.

Spermatid answered 25/7, 2018 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.