RA Queries

Embed Size (px)

DESCRIPTION

fggf

Citation preview

-------Billing summary-----------------------select count(*) from AP_INVOICE_BILLING_SUMMARYunion allselect count(*) from EDW_ENT_ADW.INVOICE_DESCRIPTOR where Descriptor_Grp_Cd='BILSUMRY' and Descriptor_Cd='IBILLSUMMNTOC';--roknaselect data_source_id from EDW_ENT_ODS.AP_INVOICE_BILLING_SUMMARYminusselect invoice_ident_1_num from EDW_ENT_ADW.invoice_ident where invoice_id in (select invoice_id from EDW_ENT_ADW.INVOICE_DESCRIPTOR where Descriptor_Grp_Cd='BILSUMRY' and Descriptor_Cd='IBILLSUMMNTOC'); --------Customer-----------------select count(*) from AP_INVOICE_HEADERunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE;select count(*) from AP_INVOICE_HEADERunion allselect count(*) from EDW_ENT_ADW.INVOICE_IDENT where Invoice_Ident_Type_Cd='INCDT';select count(*) from AP_INVOICE_HEADERunion allselect count(*) from EDW_ENT_ADW.INVOICE_DESCRIPTOR where Descriptor_Cd='CDREC';----------------------------------Discount------------------select count(*) from AP_INVOICE_DISCOUNTunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE where AP_Invoice_Line_Type_Cd='DSINV';select count(*) from AP_INVOICE_DISCOUNTunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_AMOUNT where Invoice_Amount_Type_Cd='DLMT';select count(*) from AP_INVOICE_DISCOUNTunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_DESCRIPTOR where Descriptor_Cd='DSTYP';-----event chargeselect count(*) from AP_INVOICE_EVENT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE where AP_Invoice_Line_Type_Cd='EVINV';select count(*) from AP_INVOICE_EVENT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_AMOUNT where Invoice_Amount_Type_Cd='EVTCS';select count(*) from AP_INVOICE_EVENT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_DESCRIPTOR where Descriptor_Cd='EVNTENDDT';----PRODUCT_CHARGEselect count(*) from AP_INVOICE_PRODUCT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE where AP_Invoice_Line_Type_Cd ='PCINV';select count(*) from AP_INVOICE_PRODUCT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_AMOUNT where Invoice_Amount_Type_Cd='PCPRT';select count(*) from AP_INVOICE_PRODUCT_CHARGEunion allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_DESCRIPTOR where Descriptor_Cd='PCENDT'; ----Adjustmentselect count(*) from AP_INVOICE_ADJUSTMENT --322union allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE where ap_invoice_line_type_cd='ADINV';--322select count(*) from AP_INVOICE_ADJUSTMENT --322union allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_AMOUNT where Invoice_Amount_Type_Cd='ADLNV';select count(*) from AP_INVOICE_ADJUSTMENT --322union allselect count(*) from EDW_ENT_ADW.AP_INVOICE_LINE_DESCRIPTOR where Descriptor_Cd='ADJENDDT';