I need to get the maximum value +1 for a field, if that filed as the 0000 value.
(acc_id = 0000)
(acc_id) + 1
I think you're looking to do an
This should get it done for you:
SELECT @id := MAX(acc_id) FROM crm_accounts; UPDATE crm_accounts SET acc_id = @id := @id + 1 WHERE acc_id = 0000;