三种流行的数据库查询表记录数【转】
现在三种比较流行的数据库查询表记录数分别如下:
MySql:
use information_schema;
select table_name,table_rows from tables where TABLE_SCHEMA ='数据库实例' order by table_rows desc;
SQL Server 2008:
select distinct object_name(id) as 表名,rows as 表记录数 from sysindexes order by 使用行数 desc;
Oracle:
select table_name as 表名,num_rows as 表记录数 from dba_tables where tablespace_name='表空间' order by num_rows desc;