Notes:
-
Division operator (/): Dividing
integral_typesreturns the quotient of the integer division. To perform real numbers division, at least one of the operands should be non-integer. For example:
SELECT 5/2;Result: 2SELECT 5/2::DECIMAL;SELECT 5.0/2;Result: 2.5000000000000000 -
Exponentiation operator (^): By default, multiple uses of ^ are associated left to right.
For example:
SELECT 2 ^ (3 ^ 3);Result: 134,217,728SELECT 2 ^ 3 ^ 3;Result: 512 -
Modulo operator(
%): Arguments can be eitherintegral_type(INT,BIGINT,SMALLINT) orDECIMAL. It cannot be floating-point numbers (FLOATorREAL).