select a.TABLE_NAME as "TableName", case when (select count(*) from user_views v where v.VIEW_NAME =a.TABLE_NAME )>0 then 'V' else 'U'end as "TableType", a.COLUMN_NAME as "ColumnName", A.COLUMN_ID as "ColumnIndex"
Oracle 获取表的主键.外键以及唯一约束条件 Select a.Owner 主键拥有者, a.table_name 主键表, b.Column_Name 主键列, b.Constraint_Name 主键名 From user_Constraints a, user_Cons_Columns b Where a.Constraint_Type = 'P' --P-主键:R-外键:U-唯一约束 and a.Constraint_Name = b.Constraint_Name And a.Ow