Clauses in SQL

Clauses are used in SQL to filtering , sorting and Grouping.
In SQL we use different types of  clauses. They are

1. where
2. having
3. order by
4. group by

Top is not working Oracle.

WHERE Clause

It is used to filter the records based on the condition.

Screenshot-15
ORDER BY Clause

it is used to to sort the records either ascending or descending order

Screenshot-16

GROUP BY clause

it used in the grouping of records. it used in aggregate functions.

Screenshot-17

Screenshot-18

HAVING Clause

it also used to filter the records.But it is used after using group by clause. before group by we can use where clause.

sd

Advertisements