Sunday, August 21, 2016

Oracle SQL Comparison Operators

Comparison operators :
Below is the list of comparison operators available in  Oracle SQL.

=                             equal to
>                             greater than
>=                           greater than or equal to
<                             less than
<=                           less than or equal to
BETEEEN AND        between two values
IN                            match any of the list of values
LIKE                        match a pattern
IS NULL                   is a null value


Examples:

equal to  :
SELECT *
FROM employees
WHERE hire_date='10-AUG-2007';


less than:
SELECT employee_id, first_name, phone_number, hire_date, salary
  FROM employees
 WHERE salary < 5000;

less than or equal to :
Below query gives the results less than or equal to salary 5000
SELECT employee_id, first_name, phone_number, hire_date, salary
  FROM employees
 WHERE salary <= 5000;

greater than :
SELECT employee_id, first_name, phone_number, hire_date, salary
  FROM employees
 WHERE salary > 5000;

greater than or equal to:
Below query gives the results greater  than or equal to salary 5000
SELECT employee_id, first_name, phone_number, hire_date, salary
  FROM employees
WHERE salary >= 5000;

Featured Post

Will the data from Oracle Database be lost after formatting the system in which it is installed?

So Someone asked me a question,  Will the data from Oracle Database be lost after formatting the system in which it is installed? Since the ...

Popular Posts