Subquery is a Select Statement That is Embedded in a Clause of Another
Subquery is a Select Statement That is Embedded in a Clause of Another
Types of subqueries
Single row subqueries: A single row subquery is one that returns one
row from inner SELECT statement. This type of subquery uses single
Syntax:
FROM <table_name>
Example :
Display the employee details whose job title is the same as that
of employee 1005.
Select empno,ename,job,salary,deptno
From emp
Multiple row subqueries: Subqueries that return more than one row
Operator Meaning
subquery.
subquery.
Syntax:
FROM <table_name>
where condition);
Example
Find the employees who earn the same salary as minimum salary for
departments.
Select empno,ename,job,salary,deptno
From emp
Queries that return the values from more than one column are called
Syntax:
FROM <table_name>
From emp
deptno=10);