Restricting and Sorting Data
Restricting and Sorting Data
Restricting and Sorting Data
EMPLOYEES
…
“retrieve all
employees in
department 90”
SELECT last_name
FROM employees
WHERE hire_date = '17-FEB-96' ;
Operator Meaning
= Equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
<> Not equal to
BETWEEN Between two values (inclusive)
...AND...
SELECT first_name
FROM employees
WHERE first_name LIKE 'S%' ;
• You can use the ESCAPE identifier to search for the actual %
and _ symbols.
Operator Meaning
AND Returns TRUE if both component conditions
are true
OR Returns TRUE if either component condition
is true
NOT Returns TRUE if the condition is false
Operator Meaning
1 Arithmetic operators
2 Concatenation operator
3 Comparison conditions
4 IS [NOT] NULL, LIKE, [NOT] IN
5 [NOT] BETWEEN
6 Not equal to
7 NOT logical condition
9 OR logical condition
... salary = ? …
… department_id = ? …
... last_name = ? ...
I want
to query
different
values.
…
2 - 33 Copyright © 2007, Oracle. All rights reserved.
Lesson Agenda
UNDEFINE employee_num