Name
Operators
Synopsis
An operator is a
symbol specifying an action that is performed on one or more
expressions. Operators are used most often in
DELETE
, INSERT,
SELECT, or UPDATE
statements but also are used frequently in the creation of
database objects, such as stored
procedures, functions, triggers, and views.
|
Vendor |
Command |
|---|---|
|
SQL Server |
Supported, with variations |
|
MySQL |
Supported, with variations |
|
Oracle |
Supported, with variations |
|
PostgreSQL |
Supported, with variations |
Operators typically fall into these logical categories:
-
Arithmetic operators Supported by all databases
-
Assignment operators Supported by all databases
-
Bitwiseoperators Supported by Microsoft SQL Server
-
Comparisonoperators Supported by all databases
-
Logicaloperators Supported by Oracle, Microsoft SQL Server, and PostgreSQL
-
Unary operators Supported by Oracle
Arithmetic Operators
Arithmetic operators perform mathematical operations on two expressions of any datatypes in the numeric datatype category. See Table 3.4 for a listing of the arithmatic operators.
Table 3-4. Arithmetic Operators
|
Arithmetic Operator |
Meaning |
|---|---|
|
|
Addition |
|
|
Subtraction |
|
|
Multiplication |
|
|
Division |
|
|
Modula (SQL Server only); returns the remainder of a division operation as an integer value. |
Tip
In Oracle and SQL Server, the + and - operators also can be used to perform arithmetic operations on date values.
Assignment Operators
Except in Oracle, the
assignment operator
(=) assigns the value to a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access