在 MS SQL Server 2012 中运行以下查询时,第二个查询失败但第一个查询失败。此外,在没有 where 子句的情况下运行时,两个查询都将失败。我不知道为什么两者都会失败,因为两者都应该有空的结果集。任何帮助/见解表示赞赏。
create table #temp
(id int primary key)
create table #temp2
(id int)
select 1/0
from #temp
where id = 1
select 1/0
from #temp2
where id = 1