Wednesday, 15 August 2012

oracle - Combinatorics in SQL: "Choose" Function -



oracle - Combinatorics in SQL: "Choose" Function -

using plsql developer , looking simple function n take k. can't find via google, since maintain getting info case when search "choose". thanks!

based on knowledge found on wikipedia:

function combination(n in integer, k in integer) homecoming integer l_result integer; begin in 1..k loop l_result := l_result * (n-i+1) / k; end loop; homecoming l_result; end; /

enjoy.

sql oracle plsql oracle11g plsqldeveloper

No comments:

Post a Comment