eEcho blog

is een halte van de gedachte

Subquery Syntax Mysql

http://dev.mysql.com/doc/refman/5.0/en/subqueries.html

Subquery is nested voorbeeld:

SELECT * FROM t1 WHERE column1 = (SELECT column1 FROM t2);

They allow queries that are structured so that it is possible to isolate each part of a statement.

They provide alternative ways to perform operations that would otherwise require complex joins and unions.

They are, in many people’s opinion, more readable than complex joins or unions. Indeed, it was the innovation of subqueries that gave people the original idea of calling the early SQL “Structured Query Language.”

DELETE FROM t1
WHERE s11 > ANY
(SELECT COUNT(*) /* no hint */ FROM t2
WHERE NOT EXISTS
(SELECT * FROM t3
WHERE ROW(5*t2.s1,77)=
(SELECT 50,11*s1 FROM t4 UNION SELECT 50,77 FROM
(SELECT * FROM t5) AS t5)));

Add A Comment

You must be logged in to post a comment.

Home | info@eecho.info | Voorwaarden | Blog