how to update select from many tables