1036
Views
4
Comments
Solved
'group_concat' is not a recognized built-in function name.
Question

I am using MySql Server 2014 version. While using  group_concat function, I am getting 'group_concat' is not a recognized built-in function name. error message. It would be very help[ful if you can help in this. Thanks in advance!

2021-05-14 15-16-05
Tânia Pires
Solution

Hello!

Maybe this solution will help you.

Here is a sample of data in a table:

This is one example of what we want the end result to look like:

SyntaxEditor Code Snippet

SELECT  {Person}.[Name],
        STUFF((
             SELECT ', ' + {FavoriteMovies}.[Title]
             FROM  {FavoriteMovies}
             WHERE {Person}.[Id] = {FavoriteMovies}.[PersonId]
             FOR XML PATH('') 
             ), 1, 1, '')
FROM {Person}
GROUP BY {Person}.[Name], {Person}.[Id]


Hope it helps!

Tânia Pires

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi! 

Have you tried the function "CONCAT(), this function adds two or more expressions together?

Or simply the operator  "+" between the expressions ?

Regards

Graça

2020-03-24 00-01-07
Nuno Gonçalo Pereira

Maria da Graça Peixoto wrote:

Hi! 

Have you tried the function "CONCAT(), this function adds two or more expressions together?

Or simply the operator  "+" between the expressions ?

Regards

Graça

It does not reproduce the same effect that Group_Concat. Concat make a concatenation between 2 strings, but group_concat make a concatenation of values inserted in a group.

UserImage.jpg
Mamta Garg

Maria da Graça Peixoto wrote:

Hi! 

Have you tried the function "CONCAT(), this function adds two or more expressions together?

Or simply the operator  "+" between the expressions ?

Regards

Graça


I have https://stackoverflow.com/questions/3492539/mysql-multiple-row-as-comma-separated-single-row this type of scenario. How can I execute the command like this?

2021-05-14 15-16-05
Tânia Pires
Solution

Hello!

Maybe this solution will help you.

Here is a sample of data in a table:

This is one example of what we want the end result to look like:

SyntaxEditor Code Snippet

SELECT  {Person}.[Name],
        STUFF((
             SELECT ', ' + {FavoriteMovies}.[Title]
             FROM  {FavoriteMovies}
             WHERE {Person}.[Id] = {FavoriteMovies}.[PersonId]
             FOR XML PATH('') 
             ), 1, 1, '')
FROM {Person}
GROUP BY {Person}.[Name], {Person}.[Id]


Hope it helps!

Tânia Pires

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.