MENU
Scalar Subquery
A scalar subquery is one that returns a single row containing a single column.SELECT (SELECT 500); |
500 |
SOME() and ANY() are the same.
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (200);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (200),(300),(400);
SELECT * FROM t2 WHERE b>(SELECT * FROM t1);
300 400