我有一个数据表如下:
t1
____________________________________________________
resources | companyName | Response | Score
David, Matt | companyA | YES | 5
Matt | compqanyB | NO | 8
Kyle, Kyle, David | companyC | YES | 2
如您所见,resources
是一个逗号分隔的字符串。此外,并非所有成员resources
都必须是唯一的(参见第 3 行)。
我希望任何列表中的GROUP BY
每个DISTINCT
成员都可用。所有其他列将被聚合。
预期结果:
query
______________________________________________________________________________
resources | companyName | Response | Score
David | *agregated result* | *agregated result* | *agregated result*
Matt | *agregated result* | *agregated result* | *agregated result*
Kyle | *agregated result* | *agregated result* | *agregated result*
编辑:
另一种可能:
query
____________________________________________________
resources | companyName | Response | Score
David | companyA | YES | 5
Matt | companyA | YES | 5
Matt | compqanyB | NO | 8
Kyle | companyC | YES | 2
David | companyC | YES | 2