Does the simple non-join case also work?

    SELECT * FROM (SELECT * FROM t)

Would be good to have a basic test case for this as well. Also, as long as your not doing nested aggregate queries, it would not be too difficult to support something like this:

    SELECT * FROM (SELECT * FROM t LIMIT 5) ORDER BY foo;

This is the use case where you want to use nested queries to change the default processing order of the clauses.