Announcement

Collapse
No announcement yet.

MySQL Syntax Error 1064

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL Syntax Error 1064

    I'm getting following error while updating the row in MySQL.
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near..
    Query
    Code:
    UPDATE 01_menu_main SET crid = y.newcr
    FROM (SELECT oldcrid, id as newcr FROM 01_menu_main) y
    WHERE y.oldcrid = 01_menu_main.oldcr

  • #2
    Hi,

    Use join for it

    update
    01_menu_main t1
    join 01_menu_main t2 on t2.oldcrid = t1.oldcr
    set
    t1.crid = t2.newcr
    Hope it will help you.

    Comment

    Working...
    X