Select   a.Owner 外键拥有者,
    a.Table_Name 外键表,
    c.Column_Name 外键列,
    b.Owner 主键拥有者,
    b.Table_Name 主键表,
    d.Column_Name 主键列,
    c.Constraint_Name 外键名,
    d.Constraint_Name 主键名
From User_Constraints a,
   user_Constraints b,
     user_Cons_Columns c, --外键表
     user_Cons_Columns d --主键表  
Where a.r_Constraint_Name = b.Constraint_Name   
  And a.Constraint_Type = 'R'   
  And b.Constraint_Type = 'P'   
  And a.r_Owner = b.Owner   
  And a.Constraint_Name = c.Constraint_Name   
  And b.Constraint_Name = d.Constraint_Name   
  And a.Owner = c.Owner   
  And a.Table_Name = c.Table_Name   
  And b.Owner = d.Owner   
  And b.Table_Name = d.Table_Name;

ORACLE 查询所有表、外键、主键等信息的更多相关文章

  1. oracle&&Sqlserver获取表名列名主键及数据类型

    SQlserver获得列名,列类型,列类型长度,scale,prec等数据类型(syscolumns,systypes,sysobjects均为视图) select a.name as colname ...

  2. oracle查询所有用户表的表名、主键名称、索引、外键等

    1.查找表的所有索引(包括索引名,类型,构成列): select t.*,i.index_type from user_ind_columns t,user_indexes i where t.ind ...

  3. sql查询指定表外键约束

    //////////////////查询指定表外键约束select a.name as 约束名, object_name(b.parent_object_id) as 外键表, d.name as 外 ...

  4. MYSQL的全表扫描,主键索引(聚集索引、第一索引),非主键索引(非聚集索引、第二索引),覆盖索引四种不同查询的分析

    文章出处:http://inter12.iteye.com/blog/1430144 MYSQL的全表扫描,主键索引(聚集索引.第一索引),非主键索引(非聚集索引.第二索引),覆盖索引四种不同查询的分 ...

  5. oracle中查看一张表是否有主键,主键在哪个字段上

    利用Oracle中系统自带的两个视图可以实现查看表中主键信息,语句如下:select a.constraint_name, a.column_name from user_cons_columns a ...

  6. jdbc 得到表结构、主键

    jdbc 得到表结构.主键 标签: jdbctablenullschema数据库mysql 2012-02-16 22:13 11889人阅读 评论(0) 收藏 举报  分类: Java(71)  假 ...

  7. hibernate不同条件查询结果集一样,主键@ID的原因

    这一周在翻新公司的老项目,遇到了一些预想不到的事情. 其中一个是,使用hibernate查询,不同的查询条件,居然都查到同一条记录,感觉奇怪了,开始以为是session的原因: 后来发现是hibern ...

  8. MySQL的InnoDB表如何设计主键索引-转自淘宝MySQL经典案例

    创建a表 id主键 CREATE TABLE `a` (`id` bigint(20) NOT NULL AUTO_INCREMENT ,`message_id` int(11) NOT NULL,` ...

  9. iot表输出按主键列排序,heap表不是

    <pre name="code" class="html"> create table t1 (id char(10) primary key,a1 ...

  10. hibernate 获取实体的表名、主键名、列名(转载+修改)

    package com.escs.utils; import java.util.Iterator; import org.hibernate.cfg.AnnotationConfiguration; ...

随机推荐

  1. dict以及defaultdict的简单使用

    先看一个需求 from collections import defaultdict """ 需求: 统计user_list中字母出现的次数 ""&q ...

  2. 1,Spring MVC 学习总结(一)

    一,什么是MVC MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑.数据.界面显示 ...

  3. 862C - Mahmoud and Ehab and the xor(构造)

    原题链接:http://codeforces.com/contest/862/problem/C 题意:给出n,x,求n个不同的数,使这些数的异或和为x 思路:(官方题解)只有n==2&&am ...

  4. 20180715-Java 数组

    double[] myList //首选方法 double myList[] //效果相同,但不是首选方法 该实例完整地展示了如何创建.初始化和操纵数组: public class TestArray ...

  5. Photon学习(一)——Photon Networking Free网络组件学习

    一般前端untiy程序员都很想自己学会后端网络编程,这样一个人就可以把前后端都做了,做网络游戏可比单机游戏好玩多了,笔者我对喜欢的就是mmo多人对战游戏,一起组队打副本,一起体验多人对战的乐趣.从业以 ...

  6. websocket初体验

    (function (window) { var wsUri = "ws://echo.websocket.org:9150"; var output; MyWebSocket = ...

  7. pojPseudoprime numbers (快速幂)

    Description Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a ...

  8. poj2376Cleaning Shifts (贪心求解)

    描述 大表哥分配 N (1 <= N <= 25,000) 只中的一些奶牛在牛棚附近做些清洁. 他总是要让至少一只牛做清洁.他把一天分成T段(1 <= T <= 1,000,0 ...

  9. java web中各种context的关系

    我举得这篇文章解决了我的很多疑惑,理清了我以前不太清楚的Context关系,读懂这篇文章很有助于理解源码, 原文链接在这里:https://www.jianshu.com/p/2537e2fec546 ...

  10. NYOJ 654喜欢玩warcraft的ltl(01背包/常数级优化)

    传送门 Description ltl 非常喜欢玩warcraft,因为warcraft十分讲究团队整体实力,而他自己现在也为升级而不拖累团队而努力. 他现在有很多个地点来选择去刷怪升级,但是在每一个 ...