Outer query table ref support
from the Artful MySQL Tips List
Given an outer query containing a subquery containing in turn a derived table, MySQL since version 8.0.14 allows the derived table definition to refer to tables named in the outer query or the subquery. So ...
1 When parsing a derived table def, MySQL now accepts non-lateral outer references, and
2 If the
keyword is added, MySQL also searches the
clause containing the derived table.
SQL standard SQL92 and since have supported these capabilities. Details here
Return to the Artful MySQL Tips page