Mysql method to change the table name to uppercase: 1. Open the command window; 2. Execute "SELECT concat('alter table ', TABLE_NAME , ' rename to ' , uppe(TABLE_NAME) ,' ;' ) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'xxx';" command can change the table name to uppercase.
The operating environment of this tutorial: Windows 10 system, MySQL version 5.7, Dell G3 computer.
mysql How to change the table name to uppercase?
mysql converts some table names into uppercase letters
1. Execute the following command (wen51 is the name of your database, you only need to change it here, no other changes are needed) to get the uppercase converted SQL statement of all table names in this database.
SELECT concat('alter table ', TABLE_NAME , ' rename to ' , upper(TABLE_NAME) ,' ;' ) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'wen51';
2. Copy the SQL statement of the table name that you need to change to uppercase from "Result 1" and execute it together.
3. Pitfall Diary
alter table 原表名 rename to 新表名;
For example:
alter table sys_area rename to sys_area1;
There is no error in execution!
but! ! !
ALTER TABLE act_app_deployment RENAME TO UPPER('act_app_deployment');
will always report error 1064! ! !
UPPER function usage:
Simply put: UPPER must be used after SELECT, it is only used to display results! ! !
Recommended learning: "MySQL Video Tutorial"
The above is the detailed content of How to change table name to uppercase in mysql. For more information, please follow other related articles on the PHP Chinese website!