MySQL Tutorial/Subquery/ALL — различия между версиями

Материал из SQL эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 13:44, 26 мая 2010

Greater than ALL

If table t2 is empty, the result is TRUE.

So, the following statement is TRUE when table t2 is empty:



SELECT * FROM t1 WHERE 1 > ALL (SELECT s1 FROM t2);


NULL subquery with "> ALL"

SELECT * FROM t1 WHERE 1 > ALL (SELECT MAX(s1) FROM t2) is NULL when table t2 is empty:
SELECT * FROM t1 WHERE 1 > ALL (SELECT MAX(s1) FROM t2);


Subqueries with ALL

Syntax:
   operand comparison_operator ALL (subquery)