这可能是一个愚蠢的问题,但它是直截了当的。
是否可以从现有视图创建视图?
假设我是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
更多推荐
发布评论