Update query for Main View