HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

SQL ISO Standard for group concatenation

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
groupsqlstandardforisoconcatenation

Problem

Is there an operator in the latest standard SQL:2011 (or earlier) that will handle group concatenation the likes of which we currently have to resort to these tricks for?

  • GROUP_CONCAT in MySQL



  • FOR XML in SQL Server



  • LISTAGG in Oracle



  • string_agg in PostgreSQL



Here's a recent question on this site for which various answers were given to different RDBMS.

Since this is a small question for the heavyweight site DBA.SE, please find two sub-parts to the question:

  • Is there a publicly accessible draft of SQL:2011?



  • Which part of the SQL standard (any revision) states that CONCAT NULL should YIELD NULL? I can't seem to track it down in the volume of text in the standard.

Solution

The wiscorp.com page SQL Standards has several older revisions and drafts of SQL:20nn (zip):

The 7IWD2-02-Foundation-2011-12.pdf, with a date of 2011-12-21 has at page 289:


If at least one of S1 and S2 is the null value, then the result of the `` is the null value.

Context

StackExchange Database Administrators Q#28698, answer score: 4

Revisions (0)

No revisions yet.