mysql - Update in the same table with an inner join -


my actual (and broken) query this:

update t_1 set b=(select b t_1 a=1)  b=1 

how can using inner join?

you can cheat mysql on this:

update t_1  set b=(select b (select * t_1) t a=1)   b=1 

a join version:

update t_1 join (select * t_1) t on t.a = 1 , t_1.b=1 set t_1.b= t.b; 

where source proving sub queries slower joins?


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -