Avatar of Nyana22
Nyana22
Flag for Canada

asked on 

Type of combination in TSQL

Hello,
If I have 4 values : A, B, C and D

I need a TSQL function that generate all the possible combination
of 2 values together.
Each generated record could not have 2 same values,
and the order is not important.

So, for the (A,B,C,D) values the result would be 6 records as the following:
A,B
A,C
A,D
B,C
B,D
C,D

How can i do this??
thanks
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
Nyana22

8/22/2022 - Mon