1. oracle中:
SELECT * FROM USER_TABLES;
2. mysql中:
SELECT * FROM USER_TABLES;
USER_TABLES提供了丰富的信息,其中较为重要的就是表中的数据行数(列NUM_ROWS),但这个列行数并不是准确的行数,可能与查询具体表的COUNT结果一致
这是因为num_rows是根据分析表后取得数据行数,必须先Analyze Table才能取得准确的数据行数。
如果想查询所有用户表中的列,可以使用USER_TAB_COLUMNS,可查询某个列都在哪些表中出现。
SELECT * FROM USER_TAB_COLUMNS;
另外,使用user_tables可查询当前用户的表;all_tables可查询所有用户的表;dba_tables查询包括系统表的所有表
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'reston';
或者:
1) show tables from schemaname; 例如: show tables from reston;
2) show tables ;
或者:
1) show tables from schemaname; 例如: show tables from reston;
2) show tables ;