Added the table aliases substitution in query clauses