You are on page 1of 10

select * from invoice_details select CIRCLE,POI_CODE,INOPT_TYPE,INOPT_NAME,DESCRIPTION,RATE,IUC,sum(NO_CALLS), sum(DURATION),INVODET_REF1,INVODET_REF2 from invoice_details where ref_Date = '31-AUG-10' and INOPT_TYPE ='CMSP' and

INVODET_REF2 ='IN' --and CIRCLE in ('STR_CIRCLE','ETR_CIR CLE') group by CIRCLE,POI_CODE,INOPT_TYPE,INOPT_NAME,DESCRIPTION,RATE,IUC,INVODET_REF1 ,INVODET_REF2 -------------------------------------BSO-----UPDATE INVOICE_DETAILS set description = 'BSO to Level 139 STD > 50 Km',invodet_ref1 = 2, rate = 0.85,amount = duration*0.85 WHERE DESCRIPTION in ('BSO to Level 139 STD up to 50 Km') AND INOPT_TYPE = 'BSO' and circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') and invodet_ref2 = 'IN' UPDATE INVOICE_DETAILS set description = 'BSO to Emergency services (100,101 & 102) of BSNL',invodet_re f1 = 2, rate = 1.2,amount = duration*1.2 WHERE DESCRIPTION in ('HIGHEST SLAB FOR BSO (0 - 50 km)') AND INOPT_TYPE = 'BSO' and POI_CODE = 'MALOCB_OCB_TDM' and invodet_ref2 = 'IN' --UPDATE INVOICE_DETAILS set --description = 'Non-CLI/Invalid CLI/Incomplete CLI calls-(Violation <0.5)', invodet_ref1 = 1, rate = 0.85,amount = duration*0.85 select * from INVOICE_DETAILS WHERE DESCRIPTION like 'Wrongly routed calls%' and INOPT_TYPE = 'UASL-F' and POI_CODE = 'VZMEWD_EWD_TAX' and invodet_ref2 = 'IN' UPDATE INVOICE_DETAILS set rate = 0.85,amount = duration*0.85 WHERE DESCRIPTION in ('Wrongly routed calls','Wrongly routed calls-(Violation <0 .5)') AND INOPT_TYPE in ('BSO','UASL-F') and circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') and RATE !='.85' and invodet_ref2 = 'IN' ------------------------------------UASL-F------------------------------------------UPDATE INVOICE_DETAILS set description = 'BSO to Level 139 STD > 50 Km',invodet_ref1 = 2,

rate = 0.85,amount = duration*0.85 WHERE DESCRIPTION in ('BSO to Level 139 STD up to 50 Km') AND INOPT_TYPE = 'UASL-F' and circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') and invodet_ref2 = 'IN' UPDATE INVOICE_DETAILS set description = 'BSO to Emergency services (100,101 & 102) of BSNL',invodet_re f1 = 2, rate = 1.2,amount = duration*1.2 WHERE DESCRIPTION in ('HIGHEST SLAB FOR BSOF (0 - 50 km)') AND INOPT_TYPE = 'UASL-F' and POI_CODE = 'MALOCB_OCB_TDM' and invodet_ref2 = 'IN' -------------------------------------------------------------CMSP---------------UPDATE INVOICE_DETAILS set description = 'CMTS to Emergency Services (100, 101 & 102) of BSNL',invodet_ ref1 = 4, rate = 1.2,amount = duration*1.2 WHERE DESCRIPTION in ('CMTS to BSO / other cellular of same service area transit ed by BSNL') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SFDTD2_OCB_TDM')

--UPDATE INVOICE_DETAILS set description = 'CMTS(National Roaming) to Emergency Services (100, 101 & 102) of BSNL',invodet_ref1 = 25, rate = 1.2,amount = duration*1.2 WHERE DESCRIPTION in ('CMTS(National Roaming) to BSO / Cellular transited by BSN L') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SFDTD2_OCB_TDM')

update invoice_details set rate = '0.85',amount = (duration *0.85), description = 'CMTS to Level 139 >50 Km', invodet_ref1= 1 WHERE circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') AND DESCRIPTION = ('CMTS to Level 139 up to 50 Km') and invodet_ref2 = 'IN'

update invoice_details set rate = '0.85',amount = (duration *0.85), description = 'CMTS to Level 139 >50 Km-For CDMA', invodet_ref1= 1 WHERE circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') AND DESCRIPTION = ('CMTS to Level 139 up to 50 Km-For CDMA') and invodet_ref2 = 'IN'

update invoice_details set rate = '0.85',amount = (duration *0.85), description = 'CMTS to Level 139 >50 Km-For GSM', invodet_ref1= 1 WHERE circle not in ('CHENNAI_CIRCLE','KO_CIRCLE') AND DESCRIPTION = ('CMTS to Level 139 up to 50 Km-For GSM') and invodet_ref2 = 'IN'

uPDATE INVOICE_DETAILS SET RATE = '0.40', AMOUNT = (DURATION * 0.40), DESCRIPTION='CMTS(National Roaming) to BSNL, ISPs, Pagers, Level 1 services like 131, 141 etc [except Emergency Services & Value Added Services] upto 50 km' WHERE POI_CODE IN ('CMREWD_EWD_TDM','SDOCB_OCB_TDM','SFDTD2_OCB_TDM','CDLTAX_OCB _TAX','SFDEWD_EWD_TDM') AND DESCRIPTION IN ('CMTS(National Roaming) to BSNL, ISPs, Pagers, Level 1 servi ces like 131, 141 etc [except Emergency Services & Value Added Services]') AND RATE = '0.2' AND INOPT_TYPE = 'CMSP' and invodet_ref2 = 'IN'

--uPDATE INVOICE_DETAILS SET RATE = '0.40', AMOUNT = (DURATION * 0.40), DESCRIPTION='CMTS(International Roaming) to BSNL, ISPs, Pagers, Level 1 services like 131, 141 etc [except Emergency Services & Value Added Services] upto 50 km ' WHERE POI_CODE IN ('CMREWD_EWD_TDM','SDOCB_OCB_TDM','SFDTD2_OCB_TDM','CDLTAX_OCB _TAX','SFDEWD_EWD_TDM') AND DESCRIPTION IN ('CMTS(International Roaming) to BSNL, ISPs, Pagers, Level 1 services like 131, 141 etc [except Emergency Services & Value Added Services]') AND RATE = '0.2' AND INOPT_TYPE = 'CMSP' and invodet_ref2 = 'IN'

--uPDATE INVOICE_DETAILS SET RATE = '0.40', AMOUNT = (DURATION * 0.40), DESCRIPTION='CMTS to BSNL, ISPs, Pagers, Level 1 services like 131, 141 etc [exc ept Emergency Services & Value Added Services] upto 50 km' WHERE POI_CODE IN ('CMREWD_EWD_TDM','SDOCB_OCB_TDM','SFDTD2_OCB_TDM','CDLTAX_OCB _TAX','SFDEWD_EWD_TDM') AND DESCRIPTION IN ('CMTS to BSNL, ISPs, Pagers, Level 1 services like 131, 141 etc [except Emergency Services & Value Added Services]') AND RATE = '0.2' AND INOPT_TYPE = 'CMSP' and invodet_ref2 = 'IN'

--UPDATE INVOICE_DETAILS set description = 'CMTS(National Roaming) to STD > 50 km',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS(National Roaming) to STD > 50 km outside LDCA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS(National Roaming) to STD > 50 km-For GSM',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS(National Roaming) to STD > 50 km outside LDCA-For GS M') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS(National Roaming) to STD > 50 km-For CDMA',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS(National Roaming) to STD > 50 km outside LDCA-For CD MA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX','TRYEWD_EWD_TA X','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS to STD > 50 km',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS to STD > 50 km outside LDCA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS to STD > 50 km-For CDMA',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS to STD > 50 km outside LDCA-For CDMA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS to STD > 50 km-For GSM',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS to STD > 50 km outside LDCA-For GSM') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

--CMTS(International Roaming) to STD > 50 km outside LDCA UPDATE INVOICE_DETAILS set description = 'CMTS(International Roaming) to STD > 50 km',invodet_ref1 = 1 WHERE DESCRIPTION in ('CMTS(International Roaming) to STD > 50 km outside LDCA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('SGDTAX_EWD_TAX','44F_OCB_TDM','PHUOCB_OCB_TAX','NALOC1_OCB_TAX ','TRYEWD_EWD_TAX','KOLOCB_OCB_TAX','SLGOCB_OCB_TAX') and invodet_ref2 = 'IN'

UPDATE INVOICE_DETAILS set description = 'CMTS to Basic, other Cellular(other than the transit cases), ISPs, Pagers, Level 1 services like 131, 141 etc in the same LDCA upto 50 km',in vodet_ref1 = 1, Rate = 0.40, AMOUNT = (DURATION * 0.40) WHERE DESCRIPTION in ('CMTS to Basic, other Cellular(other than the transit case s),STD up to 50 km outside LDCA [except Emergency Services & Value Added Service s]') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('KOLOCB_OCB_TAX') and invodet_ref2 = 'IN' and INVODET_REF8 like '%-ZA-%'

--UPDATE INVOICE_DETAILS set description = 'CMTS to Basic, other Cellular(other than the transit cases), ISPs, Pagers, Level 1 services like 131, 141 etc in the same LDCA upto 50 km-For CDMA',invodet_ref1 = 1, Rate = 0.40, AMOUNT = (DURATION * 0.40)

select * from INVOICE_DETAILS WHERE DESCRIPTION in ('CMTS to Basic, other Cellular(other than the transit case s),STD up to 50 km outside LDCA [except Emergency Services & Value Added Service s]-For CDMA') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('KOLOCB_OCB_TAX') and invodet_ref2 = 'IN' and INVODET_REF8 not like '%-ZA-%'

--UPDATE INVOICE_DETAILS

set description = 'CMTS to Basic, other Cellular(other than the transit cases), ISPs, Pagers, Level 1 services like 131, 141 etc in the same LDCA upto 50 km-For GSM',invodet_ref1 = 1, Rate = 0.40, AMOUNT = (DURATION * 0.40)

select * from INVOICE_DETAILS WHERE DESCRIPTION in ('CMTS to Basic, other Cellular(other than the transit case s),STD up to 50 km outside LDCA [except Emergency Services & Value Added Service s]-For GSM') AND INOPT_TYPE = 'CMSP' and POI_CODE in ('KOLOCB_OCB_TAX') and invodet_ref2 = 'IN' and INVODET_REF8 not like '%-ZA-%' --------------------------------NLDO---------------------update invoice_details set rate = '0.4',amount = (duration *0.4), description = 'Incoming ISD from NLDO to BSNL (F,M)', invodet_ref1= 1 WHERE --POI_CODE IN ('NGD5ES_5ES_TDM','KNG5ES_5ESS_TDM','KNM5ES_5ESS_TDM','KPL5E S_5ES_TDM','KPT5ES_5ESS_TDM','KPY5ES_5ESS_TDM','STL5ES_5ESS_TDM','TMB5ES_5ES_TDM ','VAK5ES_5ESS_TDM','VRY5ES_5ESS_TDM','BER5ES_5ESS_TDM','CTK5ES_5ESS_TDM','RKL5E S_5ESS_TDM','BFH5ES_5ES_TDM') DESCRIPTION IN ('BSO (M) / CMSP to ISD to Rest of the Europe including UK','BSO (M) / CMSP to ISD to All African Countries','BSO (M) / CMSP to ISD to Rest of th e World') AND INOPT_TYPE = 'NLDO' and invodet_ref2 = 'IN'

------------------------------------MTNL------------------------------------------------------------

UPDATE INVOICE_DETAILS set rate = 0.56,amount = duration*0.56 WHERE INOPT_TYPE = 'MTNL' and invodet_ref2 = 'IN' and rate = 0.48 -----------

AP UPDATE-----------------------Update invoice_details set rate = 0.35 , amount = duration*0.35 where description = 'Wrongly routed cal ls-(Violation <0.5)' and poi_code ='SFDTD2_OCB_TDM'

select * from invoice_details where description like 'Wrongly routed calls%' and poi_code ='SFDTD2_OCB_TDM'

-----------------------------------ILDO-----------------------UPDATE INVOICE_DETAILS SET RATE = '0.0275', AMOUNT = (DURATION * 0.0275),description = 'SriLanka to BSN L',INVODET_REF1 = 1 WHERE POI_CODE = '44G_AXE_TAX' and INOPT_NAME = 'SRILANKA_TELECOM_CH' AND INOPT_TYPE = 'ILDO' and description in ('ILDO to BSNL (F,M) & other operators up to 50 km','ILDO to BSNL (F,M) & other operators > 50 km') and invodet_ref2 = 'IN'

----------------------OUTGOING----------------------------------------------------------BSO---------UPDATE INVOICE_DETAILS set description = 'BSNL(F,M) or other BSO / Cellular / STD / ISD transited via B SNL to BSO',invodet_ref1 = 1 WHERE DESCRIPTION in ('BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS' ,'BSNL to Norway Fixed','BSNL to Sweden Fixed') AND RATE = 0.2 AND INOPT_TYPE in ('BSO','UASL-F') AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS set description = 'BSNL(F,M) or other BSO / Cellular / STD / ISD transited via B SNL to BSO',invodet_ref1 = 1,RATE = 0.2,amount = (duration *0.2) WHERE DESCRIPTION in ('BSNL to Norway Fixed','BSNL to Sweden Fixed') AND INOPT_TYPE in ('BSO','UASL-F') AND invodet_ref2 = 'OUT' ------------------------------------------CMSP----------

UPDATE INVOICE_DETAILS set description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS',inv odet_ref1 = 6 , rate = '0.2',amount = (duration *0.2) WHERE DESCRIPTION in ('BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to MTNL CMSP') AND RATE = 0.3 AND INOPT_TYPE = 'CMSP' AND invodet_ref2 = 'OUT'

update invoice_details set rate = '0.2',amount = (duration *0.2),

description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS', invodet_ref1= 6 WHERE circle not in ('STR_CIRCLE','ETR_CIRCLE') AND DESCRIPTION = ('Incoming International Calls handed over to CMTS') AND invodet_ref2 = 'OUT'

update invoice_details set rate = '0.2',amount = (duration *0.2), description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS For GSM' , invodet_ref1= 6 WHERE circle not in ('STR_CIRCLE','ETR_CIRCLE') AND DESCRIPTION = ('Incoming International Calls handed over to CMTS For GSM') AND invodet_ref2 = 'OUT'

update invoice_details set rate = '0.2',amount = (duration *0.2), description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS For CDMA ', invodet_ref1= 6 WHERE circle not in ('STR_CIRCLE','ETR_CIRCLE') AND DESCRIPTION = ('Incoming International Calls handed over to CMTS For CDMA') AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS set description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS',inv odet_ref1 = 6 WHERE DESCRIPTION in ('BSNL(F,M) or other BSO / Cellular / STD / ISD transited v ia BSNL to BSO') AND RATE = 0.2 AND INOPT_TYPE = 'CMSP' AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS set description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS For GSM',invodet_ref1 = 6 WHERE DESCRIPTION in ('BSNL(F,M) or other BSO / Cellular / STD / ISD transited v ia BSNL to BSO For GSM') AND RATE = 0.2 AND INOPT_TYPE = 'CMSP' AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS set description = 'BSNL (F,M) / BSO / other Cellular / STD via BSNL to CMTS For CDMA',invodet_ref1 = 6 WHERE DESCRIPTION in ('BSNL(F,M) or other BSO / Cellular / STD / ISD transited v ia BSNL to BSO For CDMA') AND RATE = 0.2 AND INOPT_TYPE = 'CMSP' AND invodet_ref2 = 'OUT'

------------------------------MTNL--------UPDATE INVOICE_DETAILS SET RATE = '0.34', AMOUNT = (DURATION * 0.34) WHERE DESCRIPTION in ('BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to other BSO (F) of MTNL Service Area transited via MTNL','BSNL(F,M) / othe r BSO (F,M) / Cellular/ISD transited via BSNL to other CMSPs of MTNL Service Are a transited via MTNL','BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to other BSO (F) of MTNL Service Area transited via MTNL') AND RATE = 0.49 AND INOPT_TYPE = 'MTNL' AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS SET RATE = '0.34', AMOUNT = (DURATION * 0.34) WHERE DESCRIPTION in ('BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to other BSO (F) of MTNL Service Area transited via MTNL') AND RATE = 0.2 AND INOPT_TYPE = 'MTNL' AND invodet_ref2 = 'OUT'

UPDATE INVOICE_DETAILS SET RATE = '0.2', AMOUNT = (DURATION * 0.2) WHERE DESCRIPTION in ('BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to MTNL (F)','BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to MTNL CMSP','BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to MTNL (M)','BSNL(F,M) / other BSO (F,M) / Cellular/ISD transited via BSNL to oth er BSO (F) of MTNL Service Area transited via MTNL') AND RATE = 0.3 AND INOPT_TYPE = 'MTNL' AND invodet_ref2 = 'OUT' ----------------------------------------------------------------------------------------------------------------update invoice_details set description = 'Non-CLI/Invalid CLI/Incomplete CLI cal ls/Prev-JUN-10' where description = 'Non-CLI/Invalid CLI/Incomplete CLI calls/Pr ev--JUN-10'

update invoice_details set description = 'Non-CLI/Invalid CLI/Incomplete CLI cal ls/Prev-JUL-10' where description = 'Non-CLI/Invalid CLI/Incomplete CLI calls/Pr ev--JUL-10'

delete invoice_details where description = 'Non-CLI/Invalid CLI/Incomplete CLI c alls/Prev-MAY-10' and poi_code in ('MCHCDT_CDT_TDM','MTNCDT_CDT_TDM','PPYCDT_CDT_TDM','YLSCDT_CDT_TDM','DBGEWD_EWD _TDM','KLROCB_OCB_TAX','NRGCDT_CDOT_TDM','333021_OCB_TDM','CTKOC1_OCB_TAX','KGPA XE_AXE_TAX','SLGOCB_OCB_TAX','SUROCB_OCB_TAX','VMEWD_EWD_TAX')

delete invoice_details where description = 'Non-CLI/Invalid CLI/Incomplete CLI c alls/Prev-JUN-10' and poi_code='VMEWD_EWD_TAX'

MAYANMARTEL-UPDATE---------

select * from invoice_details where poi_code = 'TBZAXE_AXE_TAX' and INOPT_NAME = 'MYANMARTEL_KO' and invodet_ref2 = 'IN' update invoice_details set rate = '0.25',AMOUNT = (DURATION * 0.25) where poi_code= 'TBZAXE_AXE_TAX' and INOPT_NAME ='MYANMARTEL_KO' and invodet_ref2 = ' IN'

You might also like