1.
SELECT A.CID,B.add1 ,B.add2,B.add3,B.add4,B.County,B.pcode ,B.street from
(SELECT CID from Claimant_Master where Claimant_Master.CID NOT IN(SELECT Cla_Id FROM Claimant_Address) AND Claimant_Master.WarrantID LIKE 'SPC%') A ,
(SELECT add1,add2,add3,add4,County,pcode, street from Claimant_Address where Cla_Id IN (SELECT CID from Claimant_Master where WarrantID='SPC6748')) B
2.Another query
SELECT A.CID,B.add1 ,B.add2,B.add3,B.add4,B.County,B.pcode ,B.street from
(SELECT CID from Claimant_Master where Claimant_Master.CID NOT IN(SELECT Cla_Id FROM Claimant_Address) AND Claimant_Master.WarrantID LIKE 'SPC%') A ,
(SELECT add1,add2,add3,add4,County,pcode, street from Claimant_Address where Cla_Id IN (SELECT CID from Claimant_Master where WarrantID='SPC6748')) B
2.Another query
select c.EnterBy,c.totalcalls astotal,c.reminder as rem,d.tot as blank from
(SELECT A.EnterBy,A.tot as totalcalls,B.Tot as reminder FROM
(SELECT COUNT(custTicketNo) AS 'tot',EnteredBy As EnterBy FROM indiatimes_cust_complaint WHERE (TDate + 2
+ TTime BETWEEN '7/22/2008 00:00:00.000' AND '7/22/2008 23:59:59.999')
and EnteredBy in(SELECT agentLoginID FROM indiatimes_agent_master WHERE (TType IN
('Admin', 'BackendAgent','FrontEndAgent'))) GROUP BY EnteredBy )A,
(SELECT EnterBy, COUNT(*) AS tot FROM IT_Reminders WHERE (entertime between '7/22/2008 00:00:00.000' and '7/22/2008
23:59:59.999' ) and Type='NT' GROUP BY EnterBy )B WHERE (A.EnterBy *= B.EnterBy))c ,
(SELECT EnteredBy, COUNT(*) AS tot FROM
Indiatimes_BlankCalls WHERE (tdate between '7/22/2008 00:00:00.000' and '7/22/2008 23:59:59.999' ) and EnteredBy in(SELECT agentLoginID FROM indiatimes_agent_master
WHERE (TType IN ('Admin', 'BackendAgent','FrontEndAgent'))) GROUP BY EnteredBy)d
where c.EnterBy *=d.EnteredBy
No comments:
Post a Comment