Access SQL 中的合并替代方案 [英] coalesce alternative in Access SQL
本文介绍了Access SQL 中的合并替代方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 T-SQL 中,您可以这样做:
In T-SQL, you can do this:
SELECT ProductId, COALESCE(Price, 0)
FROM Products
你如何在 Access SQL 中做同样的事情?我看到在 VBA 中使用 Nz 执行此操作的示例,但我正在寻找等效的 SQL.
How do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.
谢谢.
推荐答案
Access 支持 Nz
功能并允许您在查询中使用它.请注意,Nz
与 T-SQL ISNULL
函数相同.它不能像 COALESCE
那样接受任意数量的参数.
Access supports the Nz
function and allows you to use it in a query. Note though that Nz
is the same as the T-SQL ISNULL
function. It can not take an arbitrary number of parameters like COALESCE
can.
这篇关于Access SQL 中的合并替代方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文