UPDATE table using JOINS

/ Published in: MySQL
Save to your folder(s)

Update an empty name column in default_comments

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.