查看一个表有多少字段:
MySQL:
select count(*) from information_schema.COLUMNS where TABLE_SCHEMA='数据库名称' and table_name='表名'
Oracle:
select count(*) from user_tab_columns t where t.TABLE_NAME='表名/视图名'
查看一个数据库下有多少张表:
MySQL:
SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES WHERE table_schema = '数据库名' GROUP BY table_schema;
Oracle:
SELECT count(*) FROM user_tables;
查看一张表所有字段:
MySQL:
select COLUMN_NAME,column_comment from INFORMATION_SCHEMA.Columns where table_name='表名' and table_schema='数据库名'
Oracle:
select * from dba_tab_columns a where a.TABLE_NAME ='表名'