I have a table like this:
Tb_server
ID
5
6
7
Tb_upload
ID
1
2
3
I need a query which can update all the ID of Tb_server to max(Tb_upload.ID) + 1
So, the result on the Tb_server should be like this
Tb_server
ID
4
5
6
I am doing this in a shell script, so I can get the max(Tb_upload.ID) as a variable.
But what will be the query, using MySQL?
Try this: