Skip to main content

Categories: Math

FACTORIAL

Computes the factorial of the numeric expression. The input expression must be an integer from 0 to 20.

Syntax

FACTORIAL(expression integer) → bigint

  • expression: An integer expression from 0 and 20.

Examples

FACTORIAL example
SELECT FACTORIAL(0), FACTORIAL(1), FACTORIAL(5), FACTORIAL(20)
-- 1, 1, 120, 2432902008176640000