Search code examples
mysqlsqltable-rename

MySQL - Renaming table named "TABLE 12"


I'm trying to pass my problem... namely I can't rename my table named "TABLE 12" which was imported. I got a response:

#1064 - 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 ''TABLE 12' TO categories' at line 1

Solution

  • Use ` instead of ' to quote database/table/field-names in MySQL. e.g.:

    RENAME TABLE `TABLE 12` TO `categories`