简体   繁体   中英

This mysql syntax is not correct. What's wrong with it?

This code doesn't work on mysql:

update member
set member.xy = memba.surba
from memba
where member.id =memba.id

The code below0 works:

update member inner join memba on member.id =memba.id
set member.xy = memba.surba

Could you please explain what's wrong with the first code?

Multiple-table syntax:

UPDATE [LOW_PRIORITY] [IGNORE] table_references
    SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...
    [WHERE where_condition]

It would seem that you have a FROM clause that is not part of the update statement in MySQL.

See here: http://dev.mysql.com/doc/refman/5.0/en/update.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM