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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

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

c# - Search and Add Comment with OpenXML for Word -