Google News
logo
PostgreSQL - Interview Questions
What Is a Subquery?
A SQL subquery is a query placed inside of another query. Sometimes subqueries are also referred to as nested queries. Below is an example where the subquery comes after the WHERE clause; however, it is possible to have subqueries in the SELECT or FROM part of your queries.
 
SELECT name
FROM employees
WHERE id IN
  (SELECT id FROM sales_team)
Advertisement