I have an employees
table with an employeeNumber 1313
which I would like to change in the table by finding the maximum of all employee numbers and adding 1 to it. Which means 1313
will be changed to max(employeeNumber) + 1
I have a MySQL statement which returns the error 1093
:
update employees set employeeNumber = (select max(employeeNumber) from employees) + 1
where employeeNumber = 1313;
I have looked everywhere but I haven't found any question close to this one. I have seen solutions of inner join
but don't know how to make it work in this situation.
A simple MySQL statement would be much appreciated.