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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -