Sample data:
Id  User    Value
1   A       X=1
1   A       Y=2
1   A       X=1
1   A       X=1
1   A       Y=2
1   A       X=1
1   A       Y=2
1   A       X=0
1   A       NULL
1   A       NULL
I have a dataset as described in Picture I want to group them based on Id,User each value seperated by 'OR'. for E.g (X=1) OR (Y=2) OR .....
i found i can use string_agg() but it is available only in sql server 17 but i am using sql server 2014. Any Help would be appreciated.
 
    