是否可以从另一个视图创建视图?(is it possible to create a view from another view?)

编程入门 行业动态 更新时间:2024-10-25 10:25:44
是否可以从另一个视图创建视图?(is it possible to create a view from another view?)

这可能是一个愚蠢的问题,但它是直截了当的。

是否可以从现有视图创建视图?

假设我是tableA。 我从tableA创建vwtableA,现在我想从vwtableA创建vvVwtableA。

在伪代码中它将是这样的:

create view vwA as select * from tableA; create view vwvwA as select * from vwA;

这可能吗? 我正在尝试这样的事情,我没有MySQL错误执行该判断但我无法浏览第二个视图... MySQL Workbench一直在加载,我不知道这可能是原因。

我的tableA有大约10万条记录,vwA有大约5万条记录,而vwvwA也有大约5万条记录。

It's probably a silly question but it is straight forward.

Is it possible to create a view from an existing view?

Let's say I've tableA. I create vwtableA from tableA and now I want to create vvVwtableA from vwtableA.

In pseudo-code it would be something like:

create view vwA as select * from tableA; create view vwvwA as select * from vwA;

is this possible? I'm trying something like this and I get no MySQL errors executing the statment but I can't browse the second view... MySQL Workbench keeps loading for ever and I don't know if this may be the cause.

My tableA has around 100 000 records, vwA has around 50 000 records and vwvwA should have around 50 000 as well.

最满意答案

对的,这是可能的。 请参阅MySQL 文档

select_statement是一个SELECT语句,它提供视图的定义。 (当您从视图中选择时,使用SELECT语句选择有效。)select_statement可以从基表或其他视图中选择

Yes, it is possible. See MySQL documentation

The select_statement is a SELECT statement that provides the definition of the view. (When you select from the view, you select in effect using the SELECT statement.) select_statement can select from base tables or other views

更多推荐

本文发布于:2023-07-26 02:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1269596.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   create   view

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!