Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Coolness
Starting Member
4 Posts |
Posted - 2009-10-07 : 15:46:07
|
| Hi all,Say I have a table with a field of the letters of the alphabet, which for purposes here I'll say are only A,B,C,D. So my table:ABCDI can create all combinations by SELECT A.letters, B.letters FROM tblAlphabet AS A INNER JOIN tblAlphabet AS B ON A.letters!=B.lettersSoA BA CA DB AB CB DC AC BC DD AD BD CBut what if I want to say that AB==BA, and so return only these unique combinations:A BA CA DB CB DC DCan that be done with a SELECT? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-10-07 : 16:26:46
|
| replace "A.letters!=B.letters" with "a.letters < b.letters"Be One with the OptimizerTG |
 |
|
|
|
|
|