<?
//$dbname=`ProjectManagement`;
ExecuteSQL("create temporary table tmpA as select CaseID,qID,rInstance, count(*) as Freq from Responses where isDeleted=0 group by CaseID,qID,rInstance order by count(*)");
if (ShowQueryResultScalar("select count(*) from Responses, tmpA where tmpA.CaseID=Responses.CaseID and tmpA.qID=Responses.qID and tmpA.rInstance=Responses.rInstance and Freq>1")==0)
  echo "There are no duplicates on CaseID, qID, rInstance";
else
   ShowQueryResult("select * from Responses, tmpA where tmpA.CaseID=Responses.CaseID and tmpA.qID=Responses.qID and tmpA.rInstance=Responses.rInstance and Freq>1 order by Responses.CaseID,Responses.qID,Responses.rInstance");

?>