Updating for special db queries like min, max, distinct