MySQL更新查询中“字段列表"错误中的未知列

2021-11-20 00:00:00 sql mysql mysql-error-1054

尝试执行此更新查询时,我不断收到 MySQL 错误 #1054:

I keep getting MySQL error #1054, when trying to perform this update query:

UPDATE MASTER_USER_PROFILE, TRAN_USER_BRANCH
SET MASTER_USER_PROFILE.fellow=`y`
WHERE MASTER_USER_PROFILE.USER_ID = TRAN_USER_BRANCH.USER_ID
AND TRAN_USER_BRANCH.BRANCH_ID = 17

这可能是一些语法错误,但我已经尝试使用内部连接和其他更改,但我一直收到相同的消息:

It's probably some syntax error, but I've tried using an inner join instead and other alterations, but I keep getting the same message:

Unknown column 'y' in 'field list' 

推荐答案

尝试对 "y" 使用不同的引号,因为标识符引号字符是反引号 (`").否则 MySQL认为"您指向名为y"的列.

Try using different quotes for "y" as the identifier quote character is the backtick ("`"). Otherwise MySQL "thinks" that you point to a column named "y".

另见 MySQL 5 文档

相关文章