当前位置:网站首页>mysql将部分表名统一转换为大写
mysql将部分表名统一转换为大写
2022-07-29 09:16:00 【海是倒过来的天呀】
一、执行如下命令(wen51为你的数据库名字,只需要改这里,其他地方都不用变),得到此数据库所有表名的大写转换的SQL语句。
SELECT
concat('alter table ', TABLE_NAME , ' rename to ' , upper(TABLE_NAME) ,' ;' )
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'wen51';

二、将你需要改为大写的表名的SQL语句从“结果1”中复制出来,一并执行即可。
三、踩坑日记
alter table 原表名 rename to 新表名;
例如:
alter table sys_area rename to sys_area1;
执行是没有任何错误的!
但是!!!
ALTER TABLE act_app_deployment RENAME TO UPPER('act_app_deployment');
会一直报错1064错误!!!
UPPER函数用法:
简单说:UPPER必须用在SELECT后边,只是用于显示结果用的!!!
边栏推荐
- dataframe.to_sql() 一次性插入过多报错
- 01 knapsack about from two-dimensional optimization to one-dimensional optimization
- 网络原理笔记(五层网络)
- Parameter initialization
- AxureRP原型设计 快速开始
- 2022 electrician (elementary) test question simulation test platform operation
- LeetCode刷题(6)
- Asp graduation project - based on C # +asp Design and implementation of enterprise investment value analysis system based on. Net + sqlserver (graduation thesis + program source code) -- enterprise in
- STM32 application development practice tutorial: getting to know STM32 for the first time
- Mathematical modeling clustering
猜你喜欢

SAP ooalv-sd module actual development case (add, delete, modify and check)

BI data analysis practitioners learn financial knowledge from scratch? What introductory books are recommended

mysql怎么换成中文

Sword finger offer 27. image of binary tree
数据表示与计算(进制)

Regular expression verification version number

Leetcode: interview question 08.14. Boolean operation

优秀的Allegro Skill推荐

A structured random inactivation UNET for retinal vascular segmentation

【Unity入门计划】C#与Unity-了解类和对象
随机推荐
Memory leaks and common solutions
Excellent Allegro skill recommendation
One click automated data analysis! Come and have a look at these treasure tool libraries
解决Base64 报错 Illegal base64 character
Complete knapsack problem from simplicity to ultimate
【机器学习】朴素贝叶斯代码练习
Acwing game 59 [End]
Redis series 3: highly available master-slave architecture
English high frequency suffix
Asp graduation project - based on C # +asp Design and implementation of enterprise investment value analysis system based on. Net + sqlserver (graduation thesis + program source code) -- enterprise in
【Unity入门计划】常用学习网址收藏
网络原理笔记(五层网络)
Count the list of third-party components of an open source project
Flowable 基础篇2
No swagger, what do I use?
Data is the main body of future world development, and data security should be raised to the national strategic level
2022.7.9 quick view of papers
2022年R2移动式压力容器充装考题模拟考试平台操作
State compression DP
CVPR 2022 | clonedperson: building a large-scale virtual pedestrian data set of real wear and wear from a single photo