天天看點

mysql擷取指定資料庫所有表名和擷取指定表所有字段名

查詢資料庫中所有表名

select table_name from information_schema.tables where table_schema='csdb' and table_type='base table';

查詢指定資料庫中指定表的所有字段名column_name

select column_name from information_schema.columns where table_schema='csdb' and table_name='users'