Return to Snippet

Revision: 42849
at March 11, 2011 11:20 by kat


Initial Code
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;

Initial URL

                                

Initial Description

                                

Initial Title
Auto increment in select statement

Initial Tags

                                

Initial Language
MySQL