select isnull(sum(a),0) from (select 123as a where 1!=1)t
这样后面虽然没有值但是仍然能出来一个‘0’
本文介绍了一种使用 SQL 的 isnull 函数来返回一个指定的默认值,如果查询结果为空则返回0的方法。通过一个具体的例子展示了如何在实际操作中运用此技巧。
select isnull(sum(a),0) from (select 123as a where 1!=1)t
这样后面虽然没有值但是仍然能出来一个‘0’
2175
5万+
3万+

被折叠的 条评论
为什么被折叠?