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


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' 

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

  • I had this when I was confused and used double quotes instead of single quotes around my strings. – tripleee Mar 21 '18 at 13:18

Enclose any string to be passed to the mysql server inside single quotes; e.g.:

$name = "my name"
$query = " INSERT INTO mytable VALUES ( 1 , '$name') "

Note that although the query is enclosed between double quotes, you must enclose any string in single quotes.

  • Thank you. I was trying to figure out why my query in PHP was not working, all I had to do was add the single quotes. – RiCHiE Jul 2 '16 at 5:12
  • 1
    I know this is an old post but would you be able to answer why you have to put quotes in? – RiCHiE Jul 2 '16 at 5:13
  • @RiCHiE it's usually safer when using strings. Also, makes more sense to me to put string between quotes. When you use functions like SHA1, for instance, you put quotes in the content inside like SHA1('$var') – George Jul 6 '16 at 18:48
  • This worked for me. First I tryed using backticks with no luck. – radbyx Mar 4 at 9:00

You might check your choice of quotes (use double-/ single quotes for values, strings, etc and backticks for column-names).

Since you only want to update the table master_user_profile I'd recommend a nested query:

   master_user_profile.fellow = 'y'
   master_user_profile.user_id IN (
      SELECT tran_user_branch.user_id
      FROM tran_user_branch WHERE tran_user_branch.branch_id = 17);

In my case, it was caused by an unseen trailing space at the end of the column name. Just check if you really use "y" or "y " instead.


A query like thi will also cause the error

select table1.id from table2

Where the table is specified in column select and not included in the from clause.


While working on a .Net app build with EF code first, I got this error message when trying to apply my migration where I had a Sql("UPDATE tableName SET columnName = value"); statement.

Turns out I misspelled the columnName.


I too got the same error, problem in my case is I included the column name in GROUP BY clause and it caused this error. So removed the column from GROUP BY clause and it worked!!!

protected by Community Aug 15 '14 at 2:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.