Added the table aliases substitution in query clauses
Merging with develop branch