码迷,mamicode.com
首页 > 数据库 > 详细

统一修改数据库表名字段大小写

时间:2018-08-12 17:26:59      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:address   color   role   select   char   大小   alter   数据库表   font   

select table_name from information_schema.tables where table_schema=lcxtest and table_type=base table

技术分享图片

alter table user_role rename USER_ROLE;

技术分享图片

alter table test rename test1; --修改表名

alter table test add  column name varchar(10); --添加表列

alter table test drop  column name; --删除表列

alter table test modify address char(10) --修改表列类型
||alter table test change address address  char(40)


alter table test change  column address address1 varchar(30)--修改表列名

 

SELECT
    COLUMN_NAME,
    COLUMN_TYPE
FROM
    information_schema.COLUMNS
WHERE
    table_schema = lcxtest
AND table_name = USER_ROLE

 

 

技术分享图片

 

统一修改数据库表名字段大小写

标签:address   color   role   select   char   大小   alter   数据库表   font   

原文地址:https://www.cnblogs.com/LcxSummer/p/9463117.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!