问题
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