/ Published in: MySQL
Expand |
Embed | Plain Text
SET @rank=0; UPDATE core_objective_sub_items, (SELECT objective_ptr_id, @rank:=@rank+1 AS rank FROM core_task) as one SET core_objective_sub_items.to_objective_id=one.objective_ptr_id WHERE one.rank = core_objective_sub_items.id;
You need to login to post a comment.
