Site icon

MySQL Subquery Placement


In this tutorial, we will learn about MySQL Subquery Placement. There are various types of subqueries in MySQL. The subquery’s usage is best described from its location in the SQL statement where it is used.

Subquery Placement

The chart shows the usage between the subquery table result types and the locations in a SELECT statement where each type is allowed. The tick mark shows that the particular type of subquery is allowed in the corresponding location of the SQL statement.


  Scalar Row Column Table
 FROM clause
 WHERE clause  =   ✔  ✔
 WHERE  clause <,>   ✔
 WHERE  clause IN, ALL,ANY, SOME   ✔  ✔  ✔
 WHERE  clause EXISTS  ✔  ✔  ✔  ✔


For example, it shows that only a scalar subquery is allowed in the column designation of a SELECT statement. However, all types of subquery table results are allowed in the FROM clause of a statement.

MySQL Tutorials

MySQL Tutorials on this website:

For more information on MySQL Database:

Exit mobile version