当前位置:网站首页>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后边,只是用于显示结果用的!!!
边栏推荐
- Information system project manager must recite the quality grade of the core examination site (53)
- MySQL error summary
- Complete knapsack problem from simplicity to ultimate
- What should I pay attention to now? Excuse me, is it safe to open a stock account by mobile phone?
- AI is at the forefront | focusing on natural language processing, machine learning and other fields; From Fudan University, Institute of automation, Chinese Academy of Sciences and other teams
- Introduction to translation professional qualification (level) examination
- ICMP message analysis
- Demonstration and solution of dirty reading, unrepeatable reading and unreal reading
- 四元数与其在Unity中的简单应用
- C language -- 23 two-dimensional array
猜你喜欢

C language -- 23 two-dimensional array
Notes on network principles (five layer network)

Sword finger offer 32 - ii Print binary tree II from top to bottom

smart-webcomponents 14.2.0 Crack
![[machine learning] logistic regression code exercise](/img/dc/203f240e2eb213dbd6173d17e47ec6.jpg)
[machine learning] logistic regression code exercise

(Video + graphics) introduction to machine learning series - Chapter 1 Introduction

Leetcode:132. split palindrome string II

Leetcode question brushing (6)

Flowable UI production flow chart

C language -- 22 one dimensional array
随机推荐
Compile and install Apache for rocky Foundation
Network knowledge summary
LeetCode刷题(6)
Count the list of third-party components of an open source project
Memory leaks and common solutions
基于ArkUI eTS开发的坚果新闻(NutNews)
2022年R2移动式压力容器充装考题模拟考试平台操作
不同数据库相同字段查不重复数据
2022 Shandong Province safety officer C certificate work certificate question bank and answers
CVPR 2022 | clonedperson: building a large-scale virtual pedestrian data set of real wear and wear from a single photo
[unity entry program] collection of common learning websites
Flowable 基础篇2
Excellent Allegro skill recommendation
Outlook tutorial, how to create an electronic signature in outlook?
[unity entry program] C # and unity - understand classes and objects
Sword finger offer 50. the first character that appears only once
What is the difference between the pre training model and the traditional method in sorting?
RESTful 风格详解
Basic part 2 of flowable
Reptile practice (10): send daily news