ORACLE和SQL查詢庫資料量

2022-03-14 16:48:40 字數 858 閱讀 1247

oracle根據賬號查詢每張表資料量:

select t.table_name,t.num_rows from user_tables t order by num_rows desc;

sql server查詢總資料量:

select   sum(記錄條數) as 總記錄數

from (select top (10000) a.name as 表名, max(b.rows) as 記錄條數

from sys.sysobjects as a inner join

sys.sysindexes as b on a.id = b.id

where (a.xtype = 'u')

group by a.name

order by 記錄條數 desc) as t1;

sql server分表查詢資料量:

select   a.name as 表名, max(b.rows) as 記錄條數

from sys.sysobjects as a inner join

sys.sysindexes as b on a.id = b.id

where (a.xtype = 'u')

group by a.name

order by 記錄條數 desc

mysql查詢語句:

use information_schema;

select table_name,table_rows from tables where table_schema = 'test' order by table_rows desc;

Oracle 資料庫連線查詢SQL語句

內連線 inner join 外連線 全連線 full join 左連線 left join 右連線 right join 交叉聯接 cross join 外連線與內連線不一樣,外連線返回的查詢結果中不僅包含符合條件的行,還包括左程式設計客棧表 左外連線 右表 右外連線 或者兩個連線表 全外連線 中...

Oracle 查詢資料庫表空間sql語句

查詢系統表空間 select f.tablespace name,a.total,u.used,f.free,round u.used a.total 100 used round f.free a.total 100 free from select tablespace name,sum byt...

Oracle資料庫Sql語句詳解 條件查詢

第二章 條件查詢 本章目標 where條件查詢 在查詢中使用表示式 運算子 使用like between in進行模糊查詢 where條件查詢 1 請查詢出s emp表中last name為smith的員工的資訊 select from s emp where last name smith 2 請...