Subquery Syntax: subquery (internal query) is executed once before the primary query. The subquery results are used by the primary query (external query ). Note: subqueries must be included in brackets. Place the subquery on the right of the comparison condition. Single-row operators correspond to single-row subqueries, and multi-row operators correspond to multiple-row subqueries. Subquery type: Only one row is returned for a single row subquery. Use the single row comparison operator to execute a single row subquery: SQL> select last_name from employees where salary> (select salary from employees where last_name = 'abel '); Use the group function in the query: SQL> select last_name, job_id, salary from employees where salary = (select Min (salary) from employees); having clause in the subquery: The subquery is executed first. Returns the result to the having clause in the primary query. SQL> select department_id, min (salary) from employees group by department_id having min (salary)> (select Min (salary) from employees where department_id = 50 ); multi-row subquery returns multiple rows. Use the multi-line comparison operator to indicate that in is equal to any value in the list and any value returned by the subquery is compared to all and all values returned by the subquery are compared with select employee_id, last_name, job_id, salary from employees where salary <Any (select salary from employees where job_id = 'it _ prog') and job_id <> null values in the 'it _ prog' subquery: SQL> select EMP. last_name from employees EMP where EMP. employee_id not in (select Mgr. manager_id from employees MGR );