SQL Operators-1
SQL Operators-1
This document discusses SQL operators used with Oracle Lite. Topics include:
A unary operator uses only one operand. A unary operator typically appears with its operand in
the following format:
operator operand
2.1.2 Binary Operators
A binary operator uses two operands. A binary operator appears with its operands in the
following format:
Set operators combine sets of rows returned by queries, instead of individual data items. All set
operators have equal precedence. Oracle Lite supports the following set operators:
UNION
UNION ALL
INTERSECT
MINUS
The following lists the levels of precedence among the Oracle Lite SQL operators from high to
low. Operators listed on the same line have the same level of precedence:
Other operators with special formats accept more than two operands. If an operator receives a
null operator, the result is always null. The only operator that does not follow this rule is
CONCAT.
With Oracle Lite, you can concatenate character strings with the following results:
CONCAT(CONCAT(ENAME
-------------------------
KING is a PRESIDENT
BLAKE is a MANAGER
CLARK is a MANAGER
JONES is a MANAGER
FORD is a ANALYST
SCOTT is a ANALYST
6 rows selected.
Oracle Lite treats zero-length character strings as nulls. When you concatenate a zero-
length character string with another operand the result is always the other operand. A null
value can only result from the concatenation of two null strings.
AND Returns TRUE if both component conditions are SELECT * FROM EMP WHERE
TRUE. Returns FALSE if either is FALSE; job='CLERK' AND deptno=10
otherwise returns UNKNOWN.
OR Returns TRUE if either component condition is SELECT * FROM emp WHERE
TRUE. Returns FALSE if both are FALSE. job='CLERK' OR deptno=10
Otherwise, returns UNKNOWN.
2.6 Set Operators
Set operators combine the results of two queries into a single result.
UNION
UNION
Note: :
The syntax for INTERSECT ALL is supported, but it returns the same results as INTERSECT.