1

I am trying to execute this

  UPDATE product
SET Product_entr_notes = t2.note
    ,Product_entr_email = t2.email
    ,Product_entr_mobile = t2.Mobile
    ,Product_entr_phone = t2.Home_Phone
FROM product AS t1
INNER JOIN result AS t2 ON t1.id = t2.ACTID

But I am getting

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM product t1 INNER JOIN result t2 ON t1.id = t2.ACTID WHERE t1.id = t2.ACTID' at line 1

apomene
  • 14,282
  • 9
  • 46
  • 72
nealmegh
  • 25
  • 8

1 Answers1

0

You should put JOIN right after Update, like:

UPDATE product t1
INNER JOIN result AS t2 ON t1.id = t2.ACTID
SET Product_entr_notes = t2.note
    ,Product_entr_email = t2.email
    ,Product_entr_mobile = t2.Mobile
    ,Product_entr_phone = t2.Home_Phone
apomene
  • 14,282
  • 9
  • 46
  • 72
  • Thanks it worked. But I saw this thread https://stackoverflow.com/questions/2334712/how-do-i-update-from-a-select-in-sql-server Which I tried. Thanks for the help. – nealmegh May 07 '18 at 13:25