我有这个表:T-SQL查询来寻找共同的特点
ID Value
------------
1 car
1 moto
2 car
2 moto
3 moto
3 apple
4 gel
4 moto
5 NULL
注意moto
是共同的所有ID。
我会获得一个单行这个结果
car*, moto, apple*, gel*
即
car, apple, gel
有星号,因为是存在的,但并不是在所有的IDmoto
没有星号,因为是常有的事到所有ID
为什么选择Oracle? OP指定TSQL。 –
@MartinSmith因为我给了他错误的链接:-)我收集了一些关于STRING_AGG替代品的链接,我给了他一个错误的链接 – xanatos