I need a query which can be used in (or as) a function and retrieves all permutations of n values. And I need all permutations of length k where k = 1..n.
Extended sample input and result so input has 3 values instead of 2 - however, number of input values may vary from 1 to n.
Input: table with values in one column in multiple rows
Output#1: table with values concatenated in one column
asked Dec 02, 2012 at 05:52 AM in Default
You might want to start by having a look at am old speed phreak contest that does permutations... http://ask.sqlservercentral.com/questions/3045/the-word-permutation-sql-problem.html
answered Dec 02, 2012 at 10:25 AM