1

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

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

但上面的查询也返回物化视图。我怎样才能只得到表格而不是物化视图

4

1 回答 1

5

您可以忽略物化视图及其日志表(如果存在)

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)
于 2013-01-23T17:59:43.023 回答