SQL Server是否支持符合SQL:1999标准的IS DISTINCT FROM
语句?例如,查询
SELECT * FROM Bugs WHERE assigned_to IS NULL OR assigned_to <> 1;
可以使用IS DISTINCT FROM
重写
SELECT * FROM Bugs WHERE assigned_to IS DISTINCT FROM 1;
SQL Server是否支持符合SQL:1999标准的IS DISTINCT FROM
语句?例如,查询
SELECT * FROM Bugs WHERE assigned_to IS NULL OR assigned_to <> 1;
可以使用IS DISTINCT FROM
重写
SELECT * FROM Bugs WHERE assigned_to IS DISTINCT FROM 1;
1条答案
按热度按时间wn9m85ua1#
IS [NOT] DISTINCT FROM
计划包含在SQL Server 2022中(目前处于公开预览中),请参阅:对于早期版本的SQL Server,以下SO问题说明了如何使用等效(但更详细)的SQL Server表达式解决此问题: