Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

This question already has an answer here:

We thought of upgrading MySQL to new version 5.5.16. While testing the scripts with the new version, I had found one column Maxvalue is a Keyword in latest version.

For this one, we need to change all the application where it is used. Instead is there any way to make the keyword Maxvalue interpret as a Normal column, so that we will not have to change our application.

Maxvalue is just column name, it is not the maximum value.

And I am looking for some other option apart from backticks: `Maxvalue`.

share|improve this question

marked as duplicate by Paul White 16 hours ago

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers 3

I can see these choices

  • don't rename add backticks everywhere
  • rename the column

Like this

share|improve this answer

Not that I'm aware of, but you can keep the column name as "Maxvalue" if you wish, but you must remember to always dereference it when running a SQL query as follows;

SELECT max(`Maxvalue`) AS max_value
FROM `table_name`
share|improve this answer

The answers from Dave and gbn are pretty much the only way.

You could set ANSI_QUOTES for the session's SQL MODE but you would have to derefernce using double quotes instead of the backquote (the whole sentence is a link)

share|improve this answer

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