0
ALTER TABLE hotel_availability CHANGE idhotel-availability  idhotel_availability INT;

Need to execute above query but it can not execute because of "-" symbol?how can i fixed it?

err:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-availability idhotel_availability INT' at line 1

Cid
  • 14,374
  • 4
  • 25
  • 43

1 Answers1

0

Character '-' is not allowed in unquoted qualifiers. As explained in the documentation, permitted characters are basic Latin letters, digits 0-9, dollar, underscore.

So you would need to quote this identifier, using backticks:

ALTER TABLE hotel_availability CHANGE `idhotel-availability` idhotel_availability INT;
GMB
  • 195,563
  • 23
  • 62
  • 110