gpt4 book ai didi

sql-server - WHERE (ISNULL(columnName,0) > 0) 与 WHERE (columnName IS NOT NULL) AND (columnName > 0)

转载 作者:行者123 更新时间:2023-12-02 06:21:31 25 4
gpt4 key购买 nike

SELECT * FROM tableName WHERE (ISNULL(columnName,0) > 0)

SELECT * FROM tableName WHERE (columnName IS NOT NULL) AND (columnName > 0)

哪个更好?

columnName 有 int 数据类型

最佳答案

您不需要在查询中检查空值,所以我想这样会更好。

SELECT * FROM tableName WHERE columnName > 0

关于sql-server - WHERE (ISNULL(columnName,0) > 0) 与 WHERE (columnName IS NOT NULL) AND (columnName > 0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8535032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com