您好,欢迎来到软文情感网。
搜索
您的当前位置:首页sqlservernotin查询没结果

sqlservernotin查询没结果

来源:软文情感网


sql server not in 查询没结果Posted on 今天使用SQL Server 时,遇到使用not in 和not exist的查询结果有差异:not in 查询没结果。 原因:not in 遇到null就不工作了。 摘录: SELECT foreignStockId Probably returns aNULL. Try IdStock Descr stock a N

sql server not in 查询没结果 Posted on

今天使用SQL Server 时,网站空间,遇到使用not in 和not exist的查询结果有差异:not in 查询没结果。

原因:not in 遇到null就不工作了。

摘录:

SELECT foreignStockId

Probably returns a NULL. Try

IdStock Descr stock

a NOT IN (x,y,NULL) Will always return no results as it is equivalent to

a<>x and a<>y and a<>NULL which is

true and true and unknown

Which evaluates to unknown under the rules of three valued logic.

I normally use NOT EXISTS for this type of query

stock.descr stock p

原文网址:

,服务器空间,服务器

Copyright © 2019- ruangwengfa.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务