これは私のクエリです:
SELECT r.CALLID AS MultiRES,
c.CallDate AS CallDate,
cr.Institution AS Institution,
cr.Branch AS Branch
FROM tblResolution r
INNER JOIN tblcall c ON c.CallID=c.CallID AND c.CallDate=c.CallDate
INNER JOIN tblCaller cr ON cr.Institution = cr.Institution AND cr.Branch=cr.Branch
GROUP BY r.CALLID HAVING COUNT(*) > 1;
しかし、実行するとエラーが発生します。group by 句を使用して何かを行う必要があることはわかっていますが、それをどこに置くべきかわかりません。
編集:何が間違っていたのかを理解しました:
SELECT r.CALLID AS MultiRES,
c.CallDate AS CallDate,
cr.Institution AS Institution,
cr.Branch AS Branch
FROM tblResolution r
INNER JOIN tblcall c ON c.CallID=c.CallID AND c.CallDate=c.CallDate
INNER JOIN tblCaller cr ON cr.Institution = cr.Institution AND cr.Branch=cr.Branch
GROUP BY c.CallDate,cr.Institution,cr.Branch, r.CALLID HAVING COUNT(*) > 1;