【发布时间】:2020-12-22 11:34:28
【问题描述】:
我有两个表并写选择:
SELECT A.code, B.account, A.ano
FROM atable A, dtable B
where A.ano=B.dno
group by A.code, B.account, A.ano
having count(1)=1;
如果我添加 count(1)=1 的条件,我没有得到任何结果,为什么?
【问题讨论】:
-
我猜你没有
A.code_uv, B.account, A.cif_no组合只出现一次 -
count(1)只是写count(*)的一种古怪方式。我建议坚持使用标准版本。