按大日期时间筛选的 SQL 视图是否始终提供当前数据?

Will a SQL view filtered by large datetime always provide current data?

如果我今天为 table 创建一个不断获取数据的视图,例如使用 1900 和 2100 的日期过滤,"copy" 会被截断到我构建的那一刻吗视图或者因为它被过滤到一个非常大的日期,它会继续向可以访问它的用户显示当前数据吗?

If I create a view today for a table that continuasly keeps getting data, [...] will it keep showing the current data to the users that can Access it?

是的。视图实际上并不存储数据,它只是一个 sql 查询。每当您访问该视图时,该 sql 查询都会在幕后执行。所以基本上,视图总是反映存储在其底层物理表中的数据。

Here is the small demo 演示了这种行为:

create table mytable (id int, val varchar(5));
insert into mytable(id, val) values(1, 'foo')

create view myview as select id, val from mytable;
select * from myview;
id | val
-: | :--
 1 | foo
insert into mytable values(2, 'bar');
select * from myview;
id | val
-: | :--
 1 | foo
 2 | bar