No question at this time
DBA Top 10
1 A. Kavsek 10600
2 M. Cadot 8900
3 B. Vroman 5600
4 P. Wisse 4800
5 J. PĂ©ran 2000
6 . Lauri 1000
7 D. Johnson 300
8 J. Van Der Steen 200
8 G. Muijrers 200
8 R. Chandran 200
8 G. Am77 200
8 B. Bartben 200
8 N. Abdul Rahman 200
8 J. Akhtar 200
8 F. Dumaguin 200
8 R. Rakotozafy 200
8 D. Ramakrishna 200
About
DBA-Village
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48496
Total active users1453
Act. users last 24h7
Act. users last hour0
Registered user hits last week218
Registered user hits last month602
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, 24 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, 24 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, 24 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, 6 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