ACCESS 查询count问题,当count为null,我要它显示0,而不是直接不显示

SELECT [a.id], a.title, b.tname, a.createtime, [a.ip], COUNT(c.mid) AS Expr1 FROM ((tb_Invitation a LEFT OUTER JOIN tb_Type b ON a.tid = b.tid) INNER JOIN tb_Message c ON a.id = c.id) WHERE (a.uid = ?) GROUP BY [a.id], a.title, b.tname, a.createtime, [a.ip]

用IIF函数解决>> SQL代码中“,COUNT(c.mid) AS Expr1 ”改为这样写:
IIF(ISNULL(COUNT(c.mid)),0,COUNT(c.mid)) AS Expr1追问

不行。。。还是老样子 少一列0的

温馨提示:答案为网友推荐,仅供参考
相似回答