aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-10-20 20:19:30 +0000
committerdrh <>2023-10-20 20:19:30 +0000
commitd5e040b6f087f0e3ec5ab604cf9eaf7d917087ed (patch)
treed09a3f8bfe73b62b998c7699a2c82649321e18e4 /src
parent71bae9f19f8c73841c0b4062af7c56bd83271e77 (diff)
downloadsqlite-d5e040b6f087f0e3ec5ab604cf9eaf7d917087ed.tar.gz
sqlite-d5e040b6f087f0e3ec5ab604cf9eaf7d917087ed.zip
Add string_agg(X,Y) as an alias for group_concat(X,Y), for compatibility
with SQLServer and PG. FossilOrigin-Name: b91c19bf2680f60d7826ab5d9e7902e2dc2a55d847bbea565a6489d47f2cc8f1
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