Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

fastest way to generate permutations of a table with n columns and put in a new table added one more question to same how to remove duplicate rows

$
0
0

As i am from mathematics background and require to do some huge permutations to start in my work kind help.

If i have a table by name sample1 with n columns what is fastest way to get all the permutations of the rows of sample1 into a new table. n>=12 say.

Please provide kind help with a link where i can get help or any code or query.

An example

say the 6 columns of a row contain

E1       E2      E3        E4        E5        E6

'[0,1]' '[1,2]'  '[2,3]'   '[3.4]'   '[4,5]'   '[9,10]' 

I need to include its permutations

like

E1       E2      E3        E4        E5        E6

'[1,2]' '[0,1]'   '[2,3]'   '[3.4]'   '[4,5]'  '[9,10]'

 '[0,1]'   '[2,3]' '[3.4]' '[4,5]'  '[9,10]' '[1,2]'

and other permutations of row 1 above if there are n columns there will be n! permutations i need them also to be generated quickly and put into a new table.
U can the headers as column name each is a varchar.

Like for the above table if there are two rows with same elements in each of its columns how to remove duplicates kind help with any query


Viewing all articles
Browse latest Browse all 717

Trending Articles