查询数据库中所有表名
select * from information_schema.tables where table_schema=‘数据库名’ and table_type=‘base table’;
查询指定数据库中指定表的所有字段名column_name
select * from information_schema.columns where table_schema=‘数据库名’ and table_name=‘表名’;
博客介绍了MySQL数据库的查询操作,包含查询数据库中所有表名的语句,以及查询指定数据库中指定表的所有字段名的语句,为数据库操作提供了实用方法。
查询数据库中所有表名
select * from information_schema.tables where table_schema=‘数据库名’ and table_type=‘base table’;
查询指定数据库中指定表的所有字段名column_name
select * from information_schema.columns where table_schema=‘数据库名’ and table_name=‘表名’;
3828

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