Reputation: 29
I have been learning postgresql, and for some reason when i do factorial operations, my terminal says: "syntax error at or near ';'".
Every other basic mathematical operations like add; sub; multiply; divide; modulo; power works, but not factorial operator.
I will link the screenshot of my terminal.
Please somebody help with this problem.screenshot
Upvotes: 1
Views: 2793
Reputation: 17764
You can use the factorial() function to get the factorial you want. Ex:
SELECT factorial(5);
Upvotes: 1
Reputation:
Postgres 14 removed the !
operator for factorial:
Remove factorial operators
!
and!!
, as well as functionnumeric_fac()
Thefactorial()
function is still supported.
Upvotes: 10