Posted By

jgomez on 03/30/12


Tagged

mysql joins


Versions (?)

UPDATE table using JOINS


 / Published in: MySQL
 

Update an empty name column in default_comments

  1. UPDATE default_comments c
  2. INNER JOIN default_profiles p ON c.user_id = p.user_id
  3. INNER JOIN default_users u ON c.user_id = u.id
  4. SET c.name = p.display_name,
  5. c.email = u.email,
  6. c.website = p.website
  7. WHERE c.name = '';

Report this snippet  

You need to login to post a comment.