Combine db updates into a single query.