Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2 dev sqlsrv: GROUP_CONCAT' is not a recognized built-in function name. #4683

Closed
FrankWarius opened this issue Dec 24, 2022 · 4 comments
Closed

Comments

@FrankWarius
Copy link

SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]'GROUP_CONCAT' is not a recognized built-in function name. (SQL: select GROUP_CONCAT(s_id) AS xrefs from [wt1224_sources] where [s_file] = 1 group by [s_name] having COUNT(s_id) > 1 order by [xrefs] asc) …\vendor\illuminate\database\Connection.php:760
#0 …\vendor\illuminate\database\Connection.php(720): Illuminate\Database\Connection->runQueryCallback('select GROUP_CO...', Array, Object(Closure))
#1 …\vendor\illuminate\database\Connection.php(422): Illuminate\Database\Connection->run('select GROUP_CO...', Array, Object(Closure))
#2 …\vendor\illuminate\database\Query\Builder.php(2650): Illuminate\Database\Connection->select('select GROUP_CO...', Array, true)
#3 …\vendor\illuminate\database\Query\Builder.php(2864): Illuminate\Database\Query\Builder->runSelect()
#4 …\vendor\illuminate\database\Query\Builder.php(3174): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#5 …\vendor\illuminate\database\Query\Builder.php(2866): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure))
#6 …\app\Services\AdminService.php(122): Illuminate\Database\Query\Builder->pluck('xrefs')
#7 …\app\Http\RequestHandlers\FindDuplicateRecords.php(60): Fisharebest\Webtrees\Services\AdminService->duplicateRecords(Object(Fisharebest\Webtrees\Tree))

@fisharebest
Copy link
Owner

It appears that SQL-Server calls this function STRING_AGG()

https://database.guide/the-sql-server-equivalent-to-group_concat/

@fisharebest
Copy link
Owner

...STRING_AGG() does not support DISTINCT.

@FrankWarius
Copy link
Author

sorry, I'm lost (this was not part of IBM's DB2 in 1985)

Did You seem this https://www.codeproject.com/Articles/691102/String-Aggregation-in-the-World-of-SQL-Server?

@FrankWarius
Copy link
Author

still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants