这可能是一个愚蠢的问题,但它很简单。
是否可以从现有 View 创建 View ?
假设我有 tableA。我从 tableA 创建 vwtableA,现在我想从 vwtableA 创建 vvVwtableA。
在伪代码中它会是这样的:
create view vwA as select * from tableA;
create view vwvwA as select * from vwA;
这可能吗? 我正在尝试类似的操作,执行语句时没有出现 MySQL 错误,但我无法浏览第二个 View ...MySQL Workbench 一直在加载,我不知道这是否是原因。
我的表 A 有大约 100,000 条记录,vwA 有大约 50,000 条记录,vwvwA 也应该有大约 50,000 条。
最佳答案
是的,这是可能的。查看 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
关于mysql - 是否可以从另一个 View 创建 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15940190/