-4

我从单个表创建了一个视图

Create view v1 as
    select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109) group by severity
union all
    select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109) group by severity
union all
    select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109) group by severity

视图已创建。但是当我在视图 ( ) 中看到的数据与select * from v1仅运行查询时不同时:

select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109)group by severity
union all
select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109)group by severity
union all
select severity,avg(days),count(bugid) from tabble1 where bugid in (105,109)group by severity

可能是什么原因以及如何解决这个问题?谢谢。

4

1 回答 1

2

我能看到的最有可能的可能性:

  • 你的观点和你的查询其实并不完全相同。其中一个可能有错字。
  • 您正在从一台服务器上的视图中运行选择,并在另一台服务器上运行特定查询(如果我在每次手动运行查询时都有一美元,我在错误的服务器上......)
  • 在针对视图运行选择和另一个选择之间,数据发生了变化。
于 2013-03-06T22:27:40.560 回答