Page 1 of 1

How can I count unique values from a string_agg query?

PostPosted: Fri Nov 15, 2024 9:08 am
by 4StarGen
I'm trying to compress the output of a string counting only the unique values in it, how can I do it?

Code: Select all
(string_agg(CASE
               WHEN expression
                  THEN some string
               ELSE NULL
               END, ',' ORDER BY cash_hand_player_statistics.date_played DESC))

Re: How can I count unique values from a string_agg query?

PostPosted: Sun Nov 17, 2024 7:49 am
by Flag_Hippo
I'm afraid I don't know or have any SQL for that but if I am able to find out anything further I will let you know.

Re: How can I count unique values from a string_agg query?

PostPosted: Mon Nov 18, 2024 2:04 pm
by Flag_Hippo
Can you please post in more detail exactly what you are trying actually to achieve with this.

Re: How can I count unique values from a string_agg query?

PostPosted: Tue Nov 19, 2024 6:01 am
by 4StarGen
it is solved already