0

I Have a two tables first table js_resume column is empty but second table js_resume column have a data

I want to compare based on js_email when js_resume is empty need to update data from second table .

FIRST TABLE

+--------------------------------+-----------+
| js_email                       | js_resume |
+--------------------------------+-----------+
| panisam@hotmail.com            |           |
| rajchara-wee@hotmail.com       |           |
| jetnipit.s1992@gmail.com       |           |
| apitsada@hotmail.co.uk         |           |
| abcd@gmail.com                 |           |
| junebb@hotmail.com             |           |
| settasak.songthummin@gmail.com |           |
| james.oth@gmail.com            |           |
| balqisbinasli@gmail.com        |           |
| austinzmys@gmail.com           |           |
+--------------------------------+-----------+


Second table

+----------------------------+-------------------+
| js_email                   | js_resume         |
+----------------------------+-------------------+
| panisam@hotmail.com        | resume_59053.docx |
| rajchara-wee@hotmail.com   | resume_59051.docx |
| ragavansamy@gmail.com      | resume_59049.doc  |
| rajchara-wee@hotmail.com   | resume_59029.doc  |
| narasimha67@gmail.com      | resume_59047.doc  |
| abcd@gmail.com             | resume_59046.doc  |
| azilin.aw@gmail.com        | resume_59045.docx |
| lwy_51@yahoo.com           | resume_59044.docx |
| limnc@singnet.com.sg       | resume_59043.doc  |
| austinzmys@gmail.com       | resume_59042.docx |
+----------------------------+-------------------+

Expected Output

+--------------------------------+----------------------------+
| js_email                       | js_resume                  |
+--------------------------------+----------------------------+
| panisam@hotmail.com            |  resume_59053.docx         |
| rajchara-wee@hotmail.com       |  resume_59051.docx         |
| jetnipit.s1992@gmail.com       |                            |
| apitsada@hotmail.co.uk         |                            |
| abcd@gmail.com                 |  resume_59046.doc          |
| junebb@hotmail.com             |                            |
| settasak.songthummin@gmail.com |                            |
| james.oth@gmail.com            |                            |
| balqisbinasli@gmail.com        |                            |
| austinzmys@gmail.com           | resume_59042.docx          |
+--------------------------------+----------------------------+
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345

1 Answers1

1

Something like this?

UPDATE FIRSTTABLE a
    JOIN Secondtable b ON a.js_email = b.js_email
SET a.js_resume = b.js_resume
Nafis Islam
  • 1,483
  • 1
  • 14
  • 34