mysql一些sql语句,查看表信息_MySQL
程序员文章站
2022-05-19 16:18:15
...
bitsCN.com
mysql一些sql语句,查看表信息
查看表字段信息
Java代码
SELECT column_name AS `列名`,
data_type AS `数据类型`,
character_maximum_length AS `字符长度`,
numeric_precision AS `数字长度`,
numeric_scale AS `小数位数`,
is_nullable AS `是否允许非空`,
CASE WHEN extra = 'auto_increment'
THEN 1 ELSE 0 END AS `是否自增`,
column_default AS `默认值`,
column_comment AS `备注`
FROM
Information_schema.columns
WHERE
table_Name='test';
2.显示数据库 表中数据项信息
Java代码
SHOW TABLE STATUS FROM `database_name`;
3.显示表名
Java代码
SHOW TABLES FROM `database_name`;
bitsCN.com上一篇: PHP与SQL注入攻击[一]_php技巧
下一篇: OSGi开发常见问题与编程技巧
推荐阅读