CassidyHunt
IS-IT--Management
I need a query that will get me all unique combination of 4 columns. Below is an example of the data:
A result that is 1,25,15,20 is the same combination as 20,15,25,1 as well as 25,1,20,15. I would only want one of those results returned. Now having 20,20,5,10 would be a unique combination. So repeated numbers in columns would be ok. Just not repeated sequence by row.
Anyone have an idea how to accomplish that?
As always your help is greatly appreciated.
Cassidy
Code:
select a1.a, b1.b, c1.c, d1.d from
(select rownum as a from part where rownum <= 100) a1,
(select rownum as b from part where rownum <= 100) b1,
(select rownum as c from part where rownum <= 100) c1,
(select rownum as d from part where rownum <= 100) d1
A result that is 1,25,15,20 is the same combination as 20,15,25,1 as well as 25,1,20,15. I would only want one of those results returned. Now having 20,20,5,10 would be a unique combination. So repeated numbers in columns would be ok. Just not repeated sequence by row.
Anyone have an idea how to accomplish that?
As always your help is greatly appreciated.
Cassidy