Fixed bug when one table exists two time in query and has different fields