updating a table in a Mysql database -


lets have in table named threadloc

id  thread 4   1 3   2 2   3 1   4 

for table

i want change table value of thread can pick thread , put in on bottom (id 1) , push other threads one.

so pick 2 be

id  thread 4   1 3   3 2   4 1   2 

update threadloc set id = id + 1 thread <> @currentthread , id < @currentid; update threadloc set id = 1 thread = @currentthread 

edit: doesn't change higher ids


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -