Skip to main content

FACTORIAL

Returns the factorial logarithm of x. If x is less than or equal to 0, the function returns 0.

Syntax

FACTORIAL( <x> )

Examples

SELECT FACTORIAL(5);

┌──────────────┐
│ factorial(5)
├──────────────┤
120
└──────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today