Numeric Operators

PL/SQL implements several operators that are useful when working with numbers. The operators that can be used with numbers are shown in Table 9-6 in order of precedence. The operators with lower precedence evaluate first while those with a higher precedence evaluate latter. For full details on a particular operator, consult Oracle’s SQL Reference manual.

Table 9-6. Numeric operators and precedence

Operator

Operation

Precedence

**

Exponentiation

1

+

Identity

2

Negation

2

*

Multiplication

3

/

Division

3

+

Addition

4

Subtraction

4

=

Equality

5

<

Less than

5

>

Greater than

5

<=

Less than or equal

5

>=

Greater than or equal

5

<>, !=, ~=, ^=

Not equal

5

IS NULL

Nullity

5

BETWEEN

Inclusive range

5

NOT

Logical negation

6

AND

Conjunction

7

OR

Inclusion

8

Get Oracle PL/SQL Programming, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.