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
IdStockDescr stock
a NOT IN (x,y,NULL) Will always return no results as it is equivalent to
ax and ay and aNULL 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
原文网址:
,服务器空间,香港服务器
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/1850794.html