Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server COMBIN function


COMBIN
 
Updated: 17 August 2010
Use COMBIN to calculate the number of combinations for a given number of items.
Syntax
SELECT [westclintech].[wct].[COMBIN] (
   <@Number, float,>
 ,<@Number_chosen, float,>)
Arguments
@Number
the number of items. @Number is an expression of type float or of a type that can be implicitly converted to float
@Number_chosen
the number of items in each combination. @Number_chosen is an expression of type float or of a type that can be implicitly converted to float
 
Return Types
float
Remarks
·         @Number and @Number_chosen are truncated to integers
·         @Number and @Number_chosen must be greater than zero
·         COMBIN = FACT(@Number) / (FACT(@Number - @Number_chosen) * FACT(@Number_chosen))
Example
 
SELECT wct.COMBIN(52,5)
Here is the result set
----------------------
2598960
 

(1 row(s) affected)



Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service