A subquery can contain one or more subqueries. Subqueries are used when the condition of query is dependent on the result of another query, which, in turn,is dependent on the result of another subquery.
For Example :-
Select * from EmployeeDetails
where Salary > /* Level 1 inner query */
(SelectMax(Salary) from EmployeeDetails where DeptNo = /* Level 2 inner query */
(Select DeptNo from DeptDetails where DeptName = 'Admin'))
For Example :-
Select * from EmployeeDetails
where Salary > /* Level 1 inner query */
(SelectMax(Salary) from EmployeeDetails where DeptNo = /* Level 2 inner query */
(Select DeptNo from DeptDetails where DeptName = 'Admin'))
No comments:
Post a Comment