-- 创建视图
CREATE VIEW VIEW_TABLE
AS
SELECT
A.TABLE_NAME,
A.column_name 字段名,A.data_type 数据类型,A.data_length 长度,A.data_precision 整数位,
A.Data_Scale 小数位,A.nullable 允许空值,A.Data_default 缺省值,B.comments 备注
--,
--C.IndexCount 索引次数
FROM
user_tab_columns A,
user_col_comments B
--,
--(select count(*) IndexCount,Column_Name from User_Ind_Columns where Table_Name = 'BASE_DEPARTMENT' group by Column_Name) C
WHERE
A.Table_Name = B.Table_Name
and A.Column_Name = B.Column_Name
--and A.Column_Name = C.Column_Name(+)
--and A.Table_Name = 'BASE_DEPARTMENT'
-- 查询视图
SELECT * FROM VIEW_TABLE
WHERE UPPER(Table_Name) LIKE '%DEPART%' -- 表名称
SELECT * FROM VIEW_TABLE WHERE 备注 IS NULL