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

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -