You are here

Restricting and Sorting Data

Scope:-

Where clause - Restrict the number of rows returned by a query

Like Operator - Restrict the charaecter value

BETWEEN...AND.. operator - Specify the criteria based on a range of value

IS NULL  - Check for Null values

Order by - Sorting the return data

 

Focused Explanation

SELECT statement allow to retrieve data from the database. We can restrict the column in our SELECT statement by listing the column names in the SELECT list. To limit the rows retrieved by a query, we can use the WHERE clause in the SELECT statement in the following statement.

 

SELECT emp_id, fname, salary, joindate

FROM employee

WHERE emp_id = 3439;

 

EMP_ID

FNAME

SALARY

JOINDATE

3439

John

5000

17-NOV-81

We can specify the condition in the WHERE clause by using comparison operators. The comparison operators are:-

Operators

Descriptions

=           

Equal

Less than

Greater than

<=

Less than or equal to

>=

Greater than or equal to

<> or !=

Not equal to