2

I'm facing a problem with mysql. A query select * from range; works on mysql 5.0.22 but does not work mysql 5.1.61. but it works with backtick: i.e.

select * from `range`; 

Kindly help in this regard.

I want mysql 5.1.61 to execute the query without backtick (`)

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
User4283
  • 781
  • 3
  • 10
  • 25
  • 2
    Is "abc" the name of the table or is that just an example? The reason I ask is because the actual table name may be a reserved word in v5.1 but not in v5.0. – John Gardeniers Oct 10 '12 at 10:51
  • abc is an example. actual table name is range – User4283 Oct 10 '12 at 11:28
  • I've check mysql reference Manual. http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html word RANGE is reserved in my MySQL 5.1 but not in 5.0. is there any possibility that i could execute query without backtick whatif the word is reserved. – User4283 Oct 10 '12 at 11:42
  • 1
    Either use backticks or change the table name. Your choice. – John Gardeniers Oct 10 '12 at 11:51
  • 1
    John, to me your answer is a proper technical analysis, and deserves to be a real answer so it can be upvoted. I'd upvote it. Any chance you could post it? – MadHatter Oct 10 '12 at 13:16

1 Answers1

3

range is a reserved word in 5.1

http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

So if you use it, you need to use the back ticks in order to tell mysql that you aren't using the reserved word. range wasn't in 5.0

Mike
  • 21,910
  • 7
  • 55
  • 79
  • Yes i read reference manual and change mysql table name instead of range to someother, Thanks Jhon for the hint. – User4283 Oct 12 '12 at 15:09