ORACLE EXISTS

In Oracle, exists clause is used with select, insert, update, delete statements. It is used to combine the queries and creating subquery.

Syntax

snippet
Where exists (subquery)

Parameters

subquery: It is a select statement which returns at least one record set.

Table 1:

ORACLE EXISTS

Table 1:

ORACLE EXISTS

Example 1

Query: select name from table1 where exists (select *from table2 where table1.id=table2.id)

ORACLE EXISTS

Example 2

Query: select id, salary from table2 where exists (select *from table1 where table2.id=table1.id)

ORACLE EXISTS

Example 3

Query: select * from table1 where not exists (select *from table2 where table1.id=table2.id)

ORACLE EXISTS
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +