No question at this time
DBA Top 10
1 M. Cadot 10400
2 A. Kavsek 7600
3 B. Vroman 4800
4 P. Wisse 4000
5 J. Schnackenberg 3200
6 J. PĂ©ran 2200
7 T. Boles 600
8 Z. Hudec 400
8 G. Lambregts 400
8 N. Havard 400
8 F. Pachot 400
About
DBA-Village
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48534
Total active users1395
Act. users last 24h0
Act. users last hour0
Registered user hits last week82
Registered user hits last month353
Go up

Find all combinations for n!
Next thread: DBPUMP API notg working properly
Prev thread: table level auditing in 12c

Message Score Author Date
Hi, Does someone know how to get the all the pe...... Lauri Mar 14, 2020, 11:28
Easy! Regards Michel ... Michel Cadot Mar 14, 2020, 12:14
Ok, but how?... Lauri Mar 14, 2020, 12:56
https://stackoverflow.com/questions/3504932/sql-fu...... Philip Wisse Apr 01, 2020, 09:52

Follow up by mail Click here


Subject: Find all combinations for n!
Author: Lauri, Netherlands
Date: Mar 14, 2020, 11:28, 189 days ago
Os info: all
Oracle info: all
Error info: n/a
Message: Hi,

Does someone know how to get the all the permutations of p elements over n elements inside a piece of SQL code,
when that set of elements is passed in the form of a string?
In my situation, I have n=p, this number correspond to n!

With n=2, I have 2.
With n=3, I have 6.
With n=4, I have 24.
and so on...

I manage to get the result if all the elements have dimension=1.
For instance, with string set = '123', I have 3 elements and they are all of dimension=1.
I have these possibilities:
123
132
213
231
312
321

But does someone has an idea of the code, if for instance dimension=2 or dimension=3?
With string set = '112233' or string set = '222333444'

Thanks by advance for any tip.

Kin Regards
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Find all combinations for n!
Author: Michel Cadot, France
Date: Mar 14, 2020, 12:14, 189 days ago
Message:
Easy!

Regards
Michel
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re-Find all combinations for n!
Author: Lauri, Netherlands
Date: Mar 14, 2020, 12:56, 189 days ago
Message: Ok, but how?
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Re-Find all combinations for n!
Author: Philip Wisse, Netherlands
Date: Apr 01, 2020, 09:52, 171 days ago
Message: https://stackoverflow.com/questions/3504932/sql-functions-factorial
https://www.geeksforgeeks.org/find-factorial-number-plsql/
https://technology.amis.nl/2011/12/13/factorial-in-oracle-sql-using-both-new-recursive-subquery-and-classic-connect-by-approach-2/

HTH, Philip
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here