1、表基本信息(Table)

 select * from user_tables t, user_tab_comments c
where c.table_name = t.table_name
and t.table_name = 'YOUR_TAB_NAME'

2、表的列信息(Column)

 select * from user_tab_columns t, user_col_comments c
where t.table_name = c.table_name
and t.column_name = c.column_name
and t.table_name = 'YOUR_TAB_NAME'
order by t.column_id

3、表的主键信息(Primary Key)

 select * from user_cons_columns ucc, user_constraints uc
where uc.constraint_type='P'
and ucc.table_name = 'YOUR_TAB_NAME'
and ucc.constraint_name = uc.constraint_name

CONSTRAINT_TYPE 列的值及含义

4、索引(Index)

 select * from user_ind_columns c, user_indexes i
where c.table_name = 'YOUR_TAB_NAME'
and c.index_name = i.index_name
and c.table_name = i.table_name

注:查询条件的参数 [YOUR_TAB_NAME] 需要大写。

Oracle —— 表结构相关的SQL的更多相关文章

  1. oracle表结构和表内容差异比对

    oracle表结构和表内容差异比对 oracle中有三种集合操作,他们会把左边和右边的select 结果集进行集合操作. union 并集 intersect 交集 minus 差集 假设有如下两张表 ...

  2. oracle表结构和表内容差异比对【原】

    oracle表结构和表内容差异比对 oracle中有三种集合操作,他们会把左边和右边的select 结果集进行集合操作. union 并集 intersect 交集 minus 差集 假设有如下两张表 ...

  3. Oracle 表结构、索引以及分区信息查询

    Oracle 表结构.索引以及分区信息查询 /* 获取表:*/ select table_name from user_tables; --当前用户的表 select table_name from ...

  4. oracle表空间相关

    数据库被划分为若干个表空间,每个表空间内保存一组相关的逻辑对象.每个表空间由一个或者多个数据文件组成.oracle中的数据逻辑上存储在表空间里,物理上存储在属于该表空间的数据文件里.表空间是用户和物理 ...

  5. Oracle表结构转换SqlSERVER表结构 脚本

    在审计工作中,有时需要将Oracle的表结构修改后再SqlSERVER中创建表结构,然后将数据导入到SqlSERVER中,在修改表结构的过程中方法狠多.手工修改,最蠢的方法,或者用工具UE批量修改,还 ...

  6. oracle表结构和数据导出时的一些勾选项说明

    使用pl/sql developer导出oracle数据库的表结构和表数据时,有一些勾选项供用户选择,需要用户根据实际情况进行勾选或取消. 导出方法如下:一.只导出表结构1.使用pl/sql deve ...

  7. Oracle表结构转Mysql表结构

    1. fnc_table_to_mysql 主体程序 create or replace function fnc_table_to_mysql ( i_owner in string, i_tabl ...

  8. oracle表结构

    表管理 新建表 语法 create table 表名 ( 列名1 类型(长度), 列名2 类型(长度), 列名3 类型(长度) ); create table:关键字,建表 后跟新建表的表名,表名长度 ...

  9. 【oracle】oracle表结构导出到Word

    因为需要写数据库文档,所以需要把数据库里边的表结构在word中用表格列出来,之前一直用powerdesigner,感觉有些麻烦,后来在网上找到了一段sql语句,经测试完全符合我的需求,不敢独享,语句如 ...

随机推荐

  1. Byte measurements

  2. hdu 4003 Find Metal Mineral 树形DP

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4003 Humans have discovered a kind of new metal miner ...

  3. ACM--South Pacific 2012

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=5 ...

  4. Hibernate中查询数据转成VO对象及注意问题

    大家都可能会遇到,在用json传输数据时,很多字段是来自不同的表数据,需要我们进行封装数据. hibernate提供这么一个方法用来直接封装查询属性: query.setResultTransform ...

  5. 【转载】c/c++在windows下获取时间和计算时间差的几种方法总结

    一.标准C和C++都可用 1.获取时间用time_t time( time_t * timer ),计算时间差使用double difftime( time_t timer1, time_t time ...

  6. StoreKit framework

    关于In-APP Purchase 1. 中文文档 基本流程: http://www.cnblogs.com/wudan7/p/3621763.html 三种购买形式及StoreKit code介绍: ...

  7. Sqli-labs less 32

    Less-32 利用上述的原理,我们可以进行尝试payload为: http://127.0.0.1/sqli-labs/Less-32/?id=-1%df%27union%20select%201, ...

  8. allow_url_include和allow_url_fopen

    allow_url_fopen没什么好说的,主要是allow_url_include 从PHP5.2开始allow_url_include就默认为Off了,而allow_url_fopen一直是On的 ...

  9. Android fill_parent、wrap_content和match_parent的区别

    三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便. 1)fill_parent 设置一个构件的布局为fill_parent将强制性地使构件扩展,以 ...

  10. Python日志输出——logging模块

    Python日志输出——logging模块 标签: loggingpythonimportmodulelog4j 2012-03-06 00:18 31605人阅读 评论(8) 收藏 举报 分类: P ...