gpt4 book ai didi

mysql - 查询从数据库中选择所有表而不是物化 View

转载 作者:行者123 更新时间:2023-11-29 04:24:37 25 4
gpt4 key购买 nike

我正在使用查询从数据库中选择所有表

select table_name from all_tables where owner='XYZ' order by table_name

但上面的查询也返回物化 View 。如何只获取表而不获取物化 View

最佳答案

你可以忽略物化 View 和它们的日志表(如果它们存在的话)

select *
from all_tables t
where owner = user
and (owner, table_name) not in (select owner, mview_name
from all_mviews l
union all
select log_owner, log_table
from all_mview_logs)

关于mysql - 查询从数据库中选择所有表而不是物化 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14485949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com