Search code examples
mysqlsqlmysql-error-1064

Update field x from second join error


I want to update a.instit but instead of result i got an error 1064

          UPDATE a
          SET a.instit = c.bezeichnung
          FROM kunde AS a
          INNER JOIN bestellte_artikel AS b
          ON a.idkunde = b.idkunde
          INNER JOIN artikel AS c
          ON b.idartikel = c.idartikel
          where 1

Thank You in Advance.


Solution

  • You're using SQL-Server syntax, try this :

    UPDATE kunde  a
    INNER JOIN bestellte_artikel  b
     ON a.idkunde = b.idkunde
    INNER JOIN artikel c
     ON b.idartikel = c.idartikel
    SET a.instit = c.bezeichnung
    where 1