oracle select query

3
SELECT OPERATION IN Oracle

Upload: nihar-ranjan-paital

Post on 16-Apr-2017

633 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Oracle Select Query

SELECT OPERATION

IN Oracle

Developer : Nihar R Paital

Page 2: Oracle Select Query

Select query retrieves information from a database and structures them into a result table.• Writing SELECT queries is a skill that you need a lot in your job.• Basically SELECT queries are difficult when there is the question of the occurrences of the following.

Using Aggregate FunctionsWithout GROUP BYWith GROUP BY

JOINSub Query

These Structures can be easily understood if you will follow the diagrammatic representation given below.

What you will get from the Diagram?

This digram gives a brief idea about How to write a query.It contains all most all keywords and clauses, which are used in SQL query, and those which are

supported in OracleYou can also collect a huge collection of syntaxes for SELECT query.

Developer : Nihar R Paital

Page 3: Oracle Select Query

WHERE

GROUP BY

ORDER BY

INNER JOIN

<AGG(f1)...>* <[f1], ... ><[f1], AGG(f2)>

SELECT

< [t1.][f1]...>< [t1.][f1],... AGG([t2.][f2])...>

FROM <t1>FROM <t1>, <t2>,...

<PREDICATE>

<PREDICATE on Aggregate>

DISTINCT

HAVING

ON

FROM

<table_name>...

<table_name>...

LEFT/RIGHT OUTER JOIN

<[t1.][f1]...>

JOINPREDICATE

<[t1.][f1]...>

Cross join Self

join

Developer : Nihar R Paital