Create an Account
username: password:
 
  MemeStreams Logo

MemeStreams Discussion

search


This page contains all of the posts and discussion on MemeStreams referencing the following web page: MySQL AB :: MySQL 5.0 Reference Manual :: 12.2.8.7 Correlated Subqueries. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

MySQL AB :: MySQL 5.0 Reference Manual :: 12.2.8.7 Correlated Subqueries
by Lost at 2:21 am EST, Nov 28, 2007

12.2.8.7. Correlated Subqueries

A correlated subquery is a subquery that contains a reference to a table that also appears in the outer query. For example:

SELECT * FROM t1 WHERE column1 = ANY
(SELECT column1 FROM t2 WHERE t2.column2 = t1.column2);

Notice that the subquery contains a reference to a column of t1, even though the subquery's FROM clause does not mention a table t1. So, MySQL looks outside the subquery, and finds t1 in the outer query.

VERY useful if say... someone makes a table field an ENUM when it should be another table or individual boolean fields.


 
 
Powered By Industrial Memetics