How can I count unique values from a string_agg query?
Posted: Fri Nov 15, 2024 9:08 am
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))