Minimize SQL UPDATE queries by grouping same field assigments to multiple entries