You can translate the question and the replies:

Listagg distinct

Hi, Denodo 8.0 supports listagg function, but can distinct clause can be used inside the listagg?
user
19-05-2021 10:52:18 -0400
code

1 Answer

Hi, I was able to successfully include a DISTINCT clause within the LISTAGG function by using this syntax: ``` SELECT LISTAGG(DISTINCT <measure expression>, <delimiter expression>) WITHIN GROUP… etc ... ``` You can find more information on the [syntax of LISTAGG here](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/appendix/syntax_of_condition_functions/analytic_functions_window_functions#listagg). However in order for this to work, I suggest you to check this prerequisite: when using the LISTAGG function, bear in mind that the Denodo Platform delegates the execution of the query to the underlying data source, so I would ensure that that data source supports LISTAGG. If your data source doesn’t support the use of LISTAGG, I suggest you try using the [GROUP_CONCAT function](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/aggregation_functions#group-concat) as an alternative, which works similarly to LISTAGG. Hope this helps!
Denodo Team
20-05-2021 13:37:54 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here