MySQL查看指定数据库的所有表及对应的记录数
use information_schema;
select table_name,table_rows from tables where TABLE_SCHEMA = 'dbname' order by table_rows desc;
查看指定表的列
select COLUMN_NAME from information_schema.COLUMNS where table_name = 'table_name';
本文介绍如何使用MySQL查询指定数据库的所有表及其记录数,并展示了如何获取指定表的列信息。通过这些实用技巧,可以帮助开发者更好地管理和了解数据库结构。
MySQL查看指定数据库的所有表及对应的记录数
use information_schema;
select table_name,table_rows from tables where TABLE_SCHEMA = 'dbname' order by table_rows desc;
查看指定表的列
select COLUMN_NAME from information_schema.COLUMNS where table_name = 'table_name';
662
4008

被折叠的 条评论
为什么被折叠?