Sunday 30 April 2017

sql - Unknown column in 'field list' error on MySQL Update query



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' 

Answer



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".



See also MySQL 5 Documentation



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...