troubleshooting Question

Type of combination in TSQL

Avatar of Nyana22
Nyana22Flag for Canada asked on
Microsoft SQL Server 2005
4 Comments2 Solutions255 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
appari

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros