IEl*_*ite 2 sql delphi interbase
SQL专家为您提供简单的SQL.
我有两个字段(AccountNo,CheckNo).可以有多个具有相同值的checkno.它将拥有相同的AccountNo.我希望mytable显示AccountNo和CheckNo的列表,以及它存在多少次的计数.
Select Distinct AccountNo, CheckNo, Count(Distinct AccountNo, CheckNo) as Total
from MyTable
Run Code Online (Sandbox Code Playgroud)
Ric*_*iwi 10
你追求的是什么 GROUP BY
Select AccountNo, CheckNo, Count(*) as Total
from MyTable
group by AccountNo, CheckNo
Run Code Online (Sandbox Code Playgroud)