-- 查询数据库中所有表名
select * from information_schema.tables where table_schema='wwwdb' and table_type='base table';
-- 查询指定数据库中指定表的所有字段名column_name
select * from information_schema.columns where table_schema='wwwdb' and table_name='days_user';
select * from information_schema.tables where table_schema='wwwdb' and table_type='base table';
-- 查询指定数据库中指定表的所有字段名column_name
select * from information_schema.columns where table_schema='wwwdb' and table_name='days_user';
本文介绍如何使用SQL语句查询指定数据库中的所有表名及指定表的所有字段名。通过两个实用示例,帮助读者掌握利用information_schema进行元数据查询的方法。
2295

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



