Imp: decorrelation

from blog Scattered Thoughts, | ↗ original
This is a part of a series - start at the beginning. In SQL, when a subquery references a variable from the surrounding query, this is called a correlated subquery. If you were feeling a bit strange, you could use a correlated subquery to express a join. These two queries are identical (as long as bar.b is a primary key): select...