加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle 中如何查询当前用户可以看到的表名、表对应的所有字段

发布时间:2020-12-12 13:43:34 所属栏目:百科 来源:网络整理
导读:前言:利用 oracle 的视图来查询表的相关信息。 oracle 查询当前用户下的表名 + 表注释 select t.table_name tableName,f.comments comments from user_tables t inner join user_tab_comments f on t.table_name = f.table_name oracle 查询某表的所有字段

前言:利用 oracle 的视图来查询表的相关信息。

oracle 查询当前用户下的表名 + 表注释

select t.table_name tableName,f.comments comments
  from user_tables t
 inner join user_tab_comments f
    on t.table_name = f.table_name

oracle 查询某表的所有字段 + 字段注释 + 字段类型

SELECT t.TABLE_NAME  tableName,t.COLUMN_NAME columnName,t.DATA_TYPE   dataType,a.COMMENTS
  FROM USER_TAB_COLUMNS t
  LEFT JOIN USER_COL_COMMENTS a
    ON t.table_name = a.table_NAME
   AND t.COLUMN_NAME = a.COLUMN_NAME

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读