aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-10-21 11:13:47 +0000
committerdrh <>2023-10-21 11:13:47 +0000
commit531ca6058e4b9c27a3ebea33a9b8b166b8a1a517 (patch)
tree64905d2ab4c2bad294ced4ef3b1b9785734ab65f /src
parent266e5d034b14615c56c09efbfafb7b6748b5c971 (diff)
parent51bb5dec6c76ed832c6fceff64bf855f9d0ea87c (diff)
downloadsqlite-531ca6058e4b9c27a3ebea33a9b8b166b8a1a517.tar.gz
sqlite-531ca6058e4b9c27a3ebea33a9b8b166b8a1a517.zip
Create the new string_agg(X,Y) aggregate function which is an alias for
the two-argument group_concat(X,Y) function, for compatibility with SQL-Server and PostgreSQL. FossilOrigin-Name: a3b3df8a9e43f1880a904b76027db56ed504a84622831c96ba1962a19bbed762
Diffstat (limited to 'src')
-rw-r--r--src/func.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/func.c b/src/func.c
index eed67941b..58ef4fef9 100644
--- a/src/func.c
+++ b/src/func.c
@@ -2047,6 +2047,7 @@ static void minMaxFinalize(sqlite3_context *context){
/*
** group_concat(EXPR, ?SEPARATOR?)
+** string_agg(EXPR, SEPARATOR)
**
** The SEPARATOR goes before the EXPR string. This is tragic. The
** groupConcatInverse() implementation would have been easier if the
@@ -2671,6 +2672,8 @@ void sqlite3RegisterBuiltinFunctions(void){
groupConcatFinalize, groupConcatValue, groupConcatInverse, 0),
WAGGREGATE(group_concat, 2, 0, 0, groupConcatStep,
groupConcatFinalize, groupConcatValue, groupConcatInverse, 0),
+ WAGGREGATE(string_agg, 2, 0, 0, groupConcatStep,
+ groupConcatFinalize, groupConcatValue, groupConcatInverse, 0),
LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
#ifdef SQLITE_CASE_SENSITIVE_LIKE