从基表中删除行会影响该表的视图吗? [英] Does deleting row from base table affect view of that table?

查看:281
本文介绍了从基表中删除行会影响该表的视图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道从视图中删除一行也会从基表中删除该行。但是我想知道从基表中删除一行对视图有何影响会令我感到惊讶。

I know that deleting a row from view will delete that row from base table also. But I think it will be more surprised to know that how does deleting a row from base table affect on view?

推荐答案

删除表中的一行将影响常规视图的结果。

Deleting a row in a table will affect the results from regular views.

创建视图时不执行。它们在引用时执行。每次您在查询中引用该视图时,它都会再次运行。因此,对基础表中数据的任何更新都会影响该视图。

Views are not executed when they are created. They are executed when they are referenced. Each time you reference the view in the query, it is run again. So, any updates to the data in the underlying tables will affect the view.

这不适用于实例化视图,在 时执行他们被创建。为了反映基础数据的变化,您需要刷新一个实例化视图。

This does not apply to materialized views, which are executed when they are created. To reflect changes in the underlying data, you need to refresh a materialized view.

这篇关于从基表中删除行会影响该表的视图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆