Subquery Limitations
Review restrictions on subquery usage. This page details unsupported operations, such as modifying a table while selecting from it in a subquery.
CREATE TABLE staff(name VARCHAR(10),age TINYINT);
CREATE TABLE customer(name VARCHAR(10),age TINYINT);INSERT INTO staff VALUES
('Bilhah',37), ('Valerius',61), ('Maia',25);
INSERT INTO customer VALUES
('Thanasis',48), ('Valerius',61), ('Brion',51);ORDER BY and LIMIT
SELECT * FROM staff WHERE name IN (SELECT name FROM customer ORDER BY name);
+----------+------+
| name | age |
+----------+------+
| Valerius | 61 |
+----------+------+Modifying and Selecting from the Same Table
Row Comparison Operations
Correlated Subqueries
Stored Functions
Last updated
Was this helpful?

