小编Gin*_*ger的帖子

SQL Server 使用带有子查询的 IN 运算符似乎是一个 BUG?

select f1 
from table1 
where f1 in (select f1) 
--running OK.

select f1 
from table1 
where f1 in (select f1 from tablex) 
-- even the column f1 does not exist in tablex, running OK.

delete from table1 
where f1 in (select f1 from tablex)
--If you do this, you may have an accident (delete all records from table1) 
--even the column f1 does not exist in tablex.
Run Code Online (Sandbox Code Playgroud)

以上 3 条 SQL 语句在 SQL Server 2008 - 2017 中都运行正常。

sql sql-server sql-server-2017

1
推荐指数
1
解决办法
93
查看次数

标签 统计

sql ×1

sql-server ×1

sql-server-2017 ×1