VIEW 定义中基础表的含义是什么

发布于 2024-10-02 17:40:06 字数 350 浏览 3 评论 0原文

我不明白,

VIEW定义中底层表的含义是什么,

A view is created by joining one or more tables. When you update record(s) in a view, it updates the records in the underlying tables that make up the view.

So, yes, you can update the data in a view providing you have the proper privileges to the underlying tables.

am not understand ,

what is the meaning of underlying table in VIEW definition ,

A view is created by joining one or more tables. When you update record(s) in a view, it updates the records in the underlying tables that make up the view.

So, yes, you can update the data in a view providing you have the proper privileges to the underlying tables.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

且行且努力 2024-10-09 17:40:06

将视图视为存储的查询,它对用户来说就像一个常规表。实际上,视图

SELECT somefield, otherfield
FROM theview

与数据库级别实际发生的情况

SELECT somefield, otherfield
FROM (
   SELECT lots, of, useless,fields, somefield, otherfield
   FROM underlying, tables
   JOIN ...
) AS theview

之间几乎没有什么区别:视图使您不必每次都编写子查询,因此在这方面它们可以节省时间。但是,视图有一个缺点,即根据基础查询,您可能无法像直接访问基础表那样对视图运行 UPDATE/DELETE 查询。

Think of a view as a stored query, which appears to the user as a regular table. In practical terms, there's very little difference between a view:

SELECT somefield, otherfield
FROM theview

and what's actually happening at the database level:

SELECT somefield, otherfield
FROM (
   SELECT lots, of, useless,fields, somefield, otherfield
   FROM underlying, tables
   JOIN ...
) AS theview

Views save you from having to write the sub-query each time, so they're a time saver in that regard. However, views have the downside that depending on the underlying query, you might not able to run UPDATE/DELETE queries against the view as you could if you were directly accessing the underlying tables.

请叫√我孤独 2024-10-09 17:40:06

这意味着您从中选择或连接以生成视图的表。在本例中,特别是字段列表中使用的字段。

It means that the tables you select from or join against to generate the view. In this case, specifically the ones used in the fields list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文