Beruflich Dokumente
Kultur Dokumente
Example:
SELECT last_name, job_id, hire_date, salary
FROM employees
WHERE job_id = 'ST_CLERK' AND hire_date > '01-Jan-00'
OR salary > 14000;
Not found
Operator Meaning
LIKE Matches a character pattern
IS NULL Is a null
BETWEEN Is between two values (inclusive)
...AND...
IN (set) Matches any of a list of values
!= Is not equal to (VAX, UNIX, PC)
^=, := Is not equal to (IBM)
<> Is not equal to (all systems)
NOT LIKE Is not like comparison string
IS NOT NULL Is not a null
A B
UNION
UNION ALL
A B A B
INTERSECT
A B
MINUS
• Simple expression:
– Column
– Pseudocolumn
– Constant
– Sequence number
– NULL
• Compound expression: A combination of other
expressions
Example:
SELECT last_name, job_id, salary,
CASE job_id WHEN 'IT_PROG' THEN 1.10*salary
WHEN 'ST_CLERK' THEN 1.15*salary
WHEN 'SA_REP' THEN 1.20*salary
ELSE salary END "REVISED_SALARY"
FROM employees;
Condition Description
Function
arg 1
performs the
operation.
arg 2 Result
value
arg n
Function
Single-row Multiple-row
functions functions
Character
General Number
Single-row
functions
Conversion Datetime
Date
– ABS(–15) 15
• SIGN: Returns –1 or 1 based on the argument
– SIGN(-15) –1
TIMESTAMP[(fractional_seconds_precision)]
From To
VARCHAR2 or CHAR NUMBER or DATE
NUMBER VARCHAR2
DATE VARCHAR2
TO_NUMBER TO_DATE
TO_CHAR TO_CHAR
TO_CHAR(date, 'fmt')
TO_NUMBER(char[, 'fmt'])
TO_DATE(char[, 'fmt'])