【发布时间】:2014-11-29 14:27:05
【问题描述】:
我在 SQL Server 中有下表:
Name1 Name2 Amount
Larry George 1
Larry Michael 1
Michael George 1
Michael Larry 1
Larry George 1
George Larry 1
如果有人能给我提供一个脚本来获得以下结果,那就太好了(名字无关紧要,例如 Larry / George = George / Larry):
Name_combination Amount
Larry / George 3
Larry / Michael 2
Michael / George 1
在此先感谢
【问题讨论】:
-
你的尝试在哪里?
-
嗨哈姆雷特 - 我不知道如何开始......
标签: sql-server unique combinations multiple-columns