Removed invalid AS keyword preceding subquery alias in JOIN condition. It breaks on Oracle and results in an ORA-00905 error.