oracle 數據庫表結構查詢

Oracle查詢用戶所有表的語句


select * from all_tab_comments 
-- 查詢所有用戶的表,視圖等


select * from user_tab_comments   
-- 查詢本用戶的表,視圖等


select * from all_col_comments


--查詢所有用戶的表的列名和註釋.
select * from user_col_comments 
-- 查詢本用戶的表的列名和註釋


select * from all_tab_columns 
--查詢所有用戶的表的列名等信息(詳細但是沒有備註).


select * from user_tab_columns 
--查詢本用戶的表的列名等信息(詳細但是沒有備註).


--一般使用1:
select t.table_name,t.comments from user_tab_comments t


--一般使用2:
select r1, r2, r3, r5
from (select a.table_name r1, a.column_name r2, a.comments r3
          from user_col_comments a),
       (select t.table_name r4, t.comments r5 from user_tab_comments t)
where r4 = r1


以上就是oracle查詢用戶所有表的語句介紹。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章