【问题标题】:Query that fetches all table names & column names in a schema [duplicate]获取模式中所有表名和列名的查询[重复]
【发布时间】:2014-03-20 22:16:46
【问题描述】:

我想检索 SCHEMA 中的所有表名和列名。因此,如果我在架构 scott 中,它应该只显示 scott 中存在的所有表。

下面的查询只能检索模式中的表吗?

Select * from tab;

【问题讨论】:

    标签: sql oracle


    【解决方案1】:
    select *
    from all_tab_columns
    where owner = 'SCOTT'
    

    手册中的更多详细信息:http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_part.htm#i125539

    【讨论】:

      【解决方案2】:

      这个查询应该可以工作:

      SELECT *
      FROM INFORMATION_SCHEMA.COLUMNS
      

      【讨论】:

      • Oracle 没有information_schema
      猜你喜欢
      • 1970-01-01
      • 2020-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-25
      • 2017-05-19
      • 1970-01-01
      相关资源
      最近更新 更多