Frage

I am trying to drop a column which has a question mark sign:

ALTER TABLE player DROP is_playing?;

Result:

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 '?' at line 2

Do you know other ways to drop it?

Thanks

War es hilfreich?

Lösung

Use backticks to escape column or tables names with special names or names of reserved keywords in MySQL.

And use the column keyword:

ALTER TABLE player DROP column `is_playing?`;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top