创建单个查询以显示具有以下前缀的所有表的名称:V$_、ALL_、USER_
Create a single query to display the names of all the tables with the following prefixes: V$_, ALL_, USER_
此查询生成所有以 V$ 开头的表的列表。
select TABLE_NAME
from DICTIONARY
where TABLE_NAME LIKE 'V$%';
如何将 remaning 前缀添加到此查询?我试过括号,使用 AND、||、OR。我在谷歌搜索中找不到这个问题的答案,尽管我已经进行了这么远的搜索,但我相信我从 diff 问题的答案中学到的百分比。
如果不是为了单一查询要求,我只会制作一个脚本,为每个前缀运行三次查询,效果很好,我只是想不出如何将它整合到一个查询中。谢谢。
V$FIXED_TABLE
怎么样。
来自文档,
This view displays all dynamic performance tables, views, and derived tables in the database. Some V$ tables (for example, V$ROLLNAME) refer to real tables and are therefore not listed.
您可以使用 TYPE
列过滤 TABLE
或 VIEW
。
要获得更广泛的结果,您可以查看 V$FIXED_VIEW_DEFINITION
。从文档中,
This view contains the definitions of all the fixed views (views beginning with V$). Use this table with caution. Oracle tries to keep the behavior of fixed views the same from release to release, but the definitions of the fixed views can change without notice. Use these definitions to optimize your queries by using indexed columns of the dynamic performance tables.
SELECT table_name
FROM dictionary
WHERE table_name LIKE 'V$\_%' ESCAPE '\'
OR table_name LIKE 'ALL\_%' ESCAPE '\'
OR table_name LIKE 'USER\_%' ESCAPE '\';
此查询生成所有以 V$ 开头的表的列表。
select TABLE_NAME
from DICTIONARY
where TABLE_NAME LIKE 'V$%';
如何将 remaning 前缀添加到此查询?我试过括号,使用 AND、||、OR。我在谷歌搜索中找不到这个问题的答案,尽管我已经进行了这么远的搜索,但我相信我从 diff 问题的答案中学到的百分比。
如果不是为了单一查询要求,我只会制作一个脚本,为每个前缀运行三次查询,效果很好,我只是想不出如何将它整合到一个查询中。谢谢。
V$FIXED_TABLE
怎么样。
来自文档,
This view displays all dynamic performance tables, views, and derived tables in the database. Some V$ tables (for example, V$ROLLNAME) refer to real tables and are therefore not listed.
您可以使用 TYPE
列过滤 TABLE
或 VIEW
。
要获得更广泛的结果,您可以查看 V$FIXED_VIEW_DEFINITION
。从文档中,
This view contains the definitions of all the fixed views (views beginning with V$). Use this table with caution. Oracle tries to keep the behavior of fixed views the same from release to release, but the definitions of the fixed views can change without notice. Use these definitions to optimize your queries by using indexed columns of the dynamic performance tables.
SELECT table_name
FROM dictionary
WHERE table_name LIKE 'V$\_%' ESCAPE '\'
OR table_name LIKE 'ALL\_%' ESCAPE '\'
OR table_name LIKE 'USER\_%' ESCAPE '\';