MySQL 4.1 and up supports subqueries and derived tables. A
“subquery” is a
SELECT statement nested within
another statement. A “derived table” (an unnamed
view) is a subquery in the
FROM clause of
another statement. See Section 12.2.8, “Subquery Syntax”.
For MySQL versions older than 4.1, most subqueries can be rewritten using joins or other methods. See Section 188.8.131.52, “Rewriting Subqueries as Joins for Earlier MySQL Versions”, for examples that show how to do this.