从视图创建视图?怎么了? [英] Create View from View? What's wrong?

查看:86
本文介绍了从视图创建视图?怎么了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个视图,首先创建了View1,然后像
一样创建了View2 创建视图View2 AS SELECT * FROM View1
现在,我通过DROP VIEW View1删除View1
我认为View1中的所有数据都已保存到View2中,但看起来并非如此.
当我从View2选择数据时,将发生错误,例如,如果我执行"SELECT * FROM View2"之类的查询,该错误将显示"Microsoft Access数据库引擎找不到输入表或查询"View1" '..."
我不明白,我的查询仅与View2有关,它如何工作?
您能否解释一下,如果可能的话,请给我另一个解决方案,我想在删除View1之前将数据保存在某处?
非常感谢!

I have 2 Views, the View1 is created first, and then View2 is created like as
CREATE VIEW View2 AS SELECT * FROM View1
Now, I drop View1 by DROP VIEW View1
I think all data in View1 has been save into View2, but it doesn''t seem like that.
When I select data from View2, an error will be made, for example, if I execute a query like "SELECT * FROM View2", the error will say "The Microsoft Access database engine cannot find the input table or query ''View1''..."
I don''t understand, my query relates to View2 only, HOW DOES IT WORK?
Could you please explain that, if possible, please give me another solution, I want to save data somewhere before dropping the View1?
Thank you so much!

推荐答案

一个视图只是一个……视图,它构成了用于查询的查询所指定的数据.它不是表,也不存储在表中.如果将view1丢弃,则无法在其他视图或查询中引用.视图也与保存数据无关,该数据已经存在于所引用的表中.如果将视图提取的数据存储在其他地方,例如在另一个表中,它将断开连接并保持静态.
A view is simply, ...well a view, of the data specified by the query used to form it. It is not a table and not stored in a table. If you drop view1 its gone you can''t reference in in other views or queries. A view is also not about saving data, the data is already present in the table(s) that are referenced. If you stored the data extracted by the view somewhere else, in another table for instance, it would be disconnected and static.


如果您在View2中引用View1,然后将View1删除希望View2正常工作?它取决于View1.视图不是表:视图不包含其自身的数据:该数据位于您要引用的任何表中.也许不要将View1或View2放在View1的源表上(这引出了View2的意义是什么?)

由于很难确定您真正要执行的操作,这是我目前能做的最好的事情.
If you refer to View1 in View2 and then drop View1 how did you expect View2 to work? It is dependent upon View1. A view is not a table: it contains no data of it''s own: the data is in whichever table you are referring to. Perhaps don''t drop View1 or base View2 on the source table of View1 (which begs the question what is the point of View2?)

Since it is difficult to work out what you are really trying to do this is about the best I can do for now.


这篇关于从视图创建视图?怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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