change fields and tables in query