Does SQL Server support IS DISTINCT FROM clause?

不打扰是莪最后的温柔 提交于 2020-01-01 07:37:12

问题


Does SQL Server support IS DISTINCT FROM statement which is SQL:1999 standard? E.g. the query

SELECT * FROM Bugs WHERE assigned_to IS NULL OR assigned_to <> 1;

can be rewritten using IS DISTINCT FROM

SELECT * FROM Bugs WHERE assigned_to IS DISTINCT FROM 1;

回答1:


No, it doesn't. The following SO question explains how to rewrite them into equivalent (but more verbose) SQL Server expressions:

  • How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM?

There's also a Uservoice entry for this issue, where you can vote for inclusion in the next release:

  • Add language and optimizer support for ISO <distinct predicate>


来源:https://stackoverflow.com/questions/12456737/does-sql-server-support-is-distinct-from-clause

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!