Blockquote
I have following records
Date Id Ethnicity Gender Age
2021-03-25 001 NULL NULL 39
2021-03-25 001 Hispanic Male 39
2022-02-01 002 NULL NULL NULL
2022-02-01 002 Unknown Male 27
2022-02-01 002 Hispanic Male 27
2022-02-01 002 NULL Male NULL
I want to write a SQL query in SQL server to concatenate the Ethnicity, Gender and Age for each Date and ID group
2021-03-25 001 Hispanic, Male, 39
2022-02-01 002 Hispanic, Male, 27
Thanks in advance!
Itried to used string_AGG() to concatenate these fields but the data is duplicated