Posted By

preasha on 08/29/11


Tagged

sql insert table update Subquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

johnw


Update table with values selected in a subquery


 / Published in: SQL
 

The inner join could be nested too

  1. UPDATE revisions AS target
  2. INNER JOIN (SELECT revision_id AS rev_id, id AS f_id FROM tmp2) AS source
  3. ON target.id = source.rev_id
  4. SET target.file_de_id = source.f_id;

Report this snippet  

You need to login to post a comment.