分享

mysql 实用操作表属性 数据库属性 等

 涅槃沉殇 2018-01-05

mysql:

select:

select * from information_schema.Columns where table_name='表名

#查询表的各个属性


select column_comment,column_name,data_type,is_nullable,column_type,numeric_precision,numeric_scale ,column_default from information_schema.Columns where table_name='表名

#查询表的 字段名字,字段注释 , 数据类型 ,是否可以为空 ,字段类型,数值精度,小数点数, 列morenzhi


select * from information_schema.tables 

查询表信息


select table_name,table_comment from information_schema.tables 

查询表  表名 ,表注释


select table_name,table_comment from information_schema.tables where table_name like '%表名%'

模糊匹配相应的表


SELECT count(*) TABLES, table_schema FROM information_schema.TABLES  where table_schema = '表名' GROUP BY table_schema;

查询数据库表总数量


edite:

alter table 表明  add  字段名   decimal(18,2)

给表增加一个字段
alter table 表明  drop column 字段名

删除表的一个字段

alter table 表名 modify  字段名 decimal(18,2) 

修改表的一个字段

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多