Hello all,
I am trying to use STRING_AGG on my sql query but getting the attached error.
I don't understand why this function doesn't exist as it the most common way to aggregate strings in sql.
If there is other method I am missing, any help will be appreciated.
Regards,
Michael
I am not sure of the context but STRING_AGG takes 2 parameters. The first is the table column name such as "Roles" or {tablename}.roles. The second is a string/char delimiter such as "," or ";". So my function would look something like this... STRING_AGG( table-name.column-name, ';' ). Good luck...
@Stanley_Stancavage my function is written just fine, the error I am presenting says that it doesn't take STRING_AGG at all.. there is no syntax issue here but something else that I am trying to understand
No the error is saying it can not find a function with a matching signature to the one you supplied.
given signature
Name: STRING_AGG
Parameter Count: 2
Parameter 1 Type: String
Paramter 2 Type: unknown
expected/known signature
Name: STRING_AGG
Parameter Count: 2
Parameter 1 Type: String
Paramter 2 Type: String
if you fix the 2nd parameter so it isn't evaluating as unknown
your problem should go away
my guess, you might be reading in a null
value in the table and trying to use it as the 2nd parameter to STRING_AGG
1 Like