select Column_name as 列名,is_nullable as 是否可为空,data_type as 数据类型,column_default as 默认值,case when column_key ='PRI' then '主键' when column_key ='UNI' then '唯一约束' when column_key ='MUL' then '可以重复' else '' end as 列键,column_comment as 字段说明 from information_schema.columns
where table_schema = 'datashar' #表所在数据库
and table_name = 'departmentinfo' order by column_key desc ; #你要查的表

MySql 查询表结构信息的更多相关文章

  1. Sqlserver查询表结构信息-字段说明、类型、长度等信息

    Sqlserver 中查询表结构信息-字段说明.类型.长度等信息综合语法. SELECT 表名 = d.name,--case when a.colorder=1 then d.name else ' ...

  2. MySQL查询表结构的SQL小结

    mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; 示例: use testDB; # ...

  3. MYSQL查询表结构

    mysql查看表结构命令,如下: desc 表名;show columns from 表名;describe 表名;show create table 表名; use information_sche ...

  4. mysql 查询表结构 查询索引

    首先进入到mysql里 show databases; 选择数据库 use xxxcms; 查询数据库下的表结构 show create table 表名; 这样看着不太好可以后面加\G show c ...

  5. MySQL查询表结构命令

    参考网址:https://www.cnblogs.com/zhangyuhang3/p/6873895.html 一.简单描述表结构,字段类型 desc tabl_name; desc tabl_na ...

  6. MySQL查询表结构的SQL语句

    desc 数据库.表名; eg: desc mysql.user;

  7. MySQL 目录结构信息

    bin 目录,存储可执行文件. data 目录,存储数据文件. docs 目录,文档. include 目录,存储包含的头文件. lib 目录,存储库文件. share 目录,错误信息和字符集文件.

  8. mysql 查询表结构

    use information_schema; select column_name, column_type, data_type, is_nullable, column_comment from ...

  9. SQLServer查询所有库表结构信息

    1.查询数据库中的所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name 2.查询某个数据库中所有的表名: SELECT Name FR ...

随机推荐

  1. js 转java后台传过来的list

    var intIndex=0; arrList = new Array(); arrList = "${orderNumList}".replace('[','').replace ...

  2. python编写shell脚本

    模块 os模块和shutil模块主要用于在python中执行一些Linux相关的操作,其中 os.system(command) 可以直接运行Linux命令,如os.system('ls'). 不过, ...

  3. Django系统

    #Django系统 -环境 - python3.6 - django1.8 -参考资料 - [django中文教程](http://python.usyiyi.cn) - django架站的16堂课 ...

  4. webstorm 2018 Eslint修复 快捷键设置

    首先确保eslint插件已安装 已勾选

  5. os.path.dirname使用方法

    import os path1=os.path.abspath(__file__) print(path1)#当前文件的绝对路径 path2=os.path.dirname(os.path.abspa ...

  6. VUE2 项目 引入 leaflet.draw全过程

    leaflet.draw的参考文档:http://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html   这个网址不稳定,多刷新几 ...

  7. 微信小程序底部弹窗动画

    第一步,在组件里编写弹窗的代码 <!-- 活动类型弹框 --> <view class='bottomModel' wx:if="{{modelFlag}}" c ...

  8. Data type

    先放官方文档: https://dev.mysql.com/doc/refman/5.5/en/data-types.html MySQL支持多种类型的SQL数据类型:数字类型,日期和时间类型,字符串 ...

  9. 【原创】canvas裁剪上传图片异步提交

    <!DOCTYPE html> canvas裁剪图片,纯前端 裁剪文件 后台返回获取裁剪后的文件

  10. Android -- Glide框架详解(一)

    1,使用这个框架快两年了,今天去github上去看了一下,貌似已经从3.X升级到4.X了,想着自己还没有对这个框架在博客上做过总结,所以这里打算出三篇博客来介绍,内容有基本使用.3.X与4.X的不通. ...