How to deal with SQL column names that look like SQL keywords?

后端 未结 14 1303
温柔的废话
温柔的废话 2020-11-22 13:24

One of my columns is called from. I can\'t change the name because I didn\'t make it. Am I allowed to do something like SELECT from FROM TableName

14条回答
  •  生来不讨喜
    2020-11-22 13:40

    I ran in the same issue when trying to update a column which name was a keyword. The solution above didn't help me. I solved it out by simply specifying the name of the table like this:

    UPDATE `survey`
    SET survey.values='yes,no'
    WHERE (question='Did you agree?')
    

提交回复
热议问题