Following is the query for getting repeated callers of a Location. But this query givs me generic view of all types of problems. So even if caller has called up 2nd time for some other problem, it includes that caller.Select cu.mobile, cu.Cust_name, z.rcvd_datetime, a.catname, b.subcatnm,c.tktname, z.problem_reported, z.engg_remarksfrom Tkt_Cat_Info a INNER JOIN Tkt_Cat_Master d ON a.catid = d.catid INNER JOIN Tkt_Type_Master e ON e.catmstrid = d.catmstrid INNER JOIN Tkt_Type_Info c ON c.tktid = e.tktid INNER JOIN Tkt_Subcat_Info b ON b.subcatid = d.subcatidINNER JOIN Ticket z ON e.tkt_typeid = z.Tkt_TypeID AND e.tkt_typeid = z.Tkt_TypeIDInner Join Customer cu On cu.custid=z.custidInner Join Location l On l.locid=cu.locidInner Join Circle ci On ci.cirid=l.ciridWhere ci.cirid=3 /* and c.tktid!=59 and c.tktname!='ABUSIVE CALLER' */and day(rcvd_datetime) between 15 and 17and month(rcvd_datetime)=10and year(rcvd_datetime)=2005/*and a.catname!='NOT APPLICABLE' and b.subcatnm!='OTHERS' */group by cu.mobile,cu.cust_name,a.catname, b.subcatnm,c.tktname,z.rcvd_datetime,z.problem_reported, z.engg_remarkshaving count(cu.cust_name)between 1 and 2order by mobile, Cust_name, rcvd_datetime,a.catname, b.subcatnm, c.tktname
Thanks Manjeet