Skip to content
Advertisement

How to name a column that is also a function name in SQL?

For example, this doesn’t work,

That is because Rank is also a function. I tried to replace Rank with [Rank] but that still doesn’t work. So, what is the solution?

Advertisement

Answer

You can give it a different name. That is what I would recommend. But absent that, the escape character in MySQL is the backtick:

Or the SQL standard, double quotes:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement