my code stock.com

marcus.sacramento

QR SIMULACAO INDICADOR REABERTURA
by marcus.sacramento

Query para Simulação do Indicador de Reabertura

Snippet options

Download: Download snippet as qr-simulacao-indicador-reabertura.sql.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

/**********************************************************************************************************************************
     Script:QR SIMULA INDICADOR REABERTURA 
         Descrição: 
             Parâmetros:  
                 Retorno: 
                     Data Criação: 
                         Responsável:Marcus Vinicius 
                             *Legenda Nome: VF-Voz Fixa(Terminal/ADSL);PB-PABX;VM-Voz Móvel;DD-Dados;CB-Combos II;PF-Combo I/Grupo-Fone;I-Indifere;O-Outros; 
                                 =============================================================Alteração=============================================================
                                     Data:                                   Responsável: 
                                         OBS: 
                                             **********************************************************************************************************************************/
                                             

SELECT 'Não-Atingida', count(ars.c1),Ars.c536871841 AS AGENTE_RESPONSAVEL
  FROM  t90 ars
 WHERE  1 = 1
            AND Ars.c536871841 in('OPERACAO_INVESTIGACAO_PROB',
'OPERACAO_INV_ESCALONA_CLY_FIXA',
'OPERACAO_INV_MIGRA_CLY_FIXA',
'OPERACAO_INV_N1_BDWEB_FIXA',
'OPERACAO_INV_N1_CLY_FIXA',
'OPERACAO_INV_N1_CLY_GSM',
'OPERACAO_INV_N1_GECO',
'OPERACAO_INV_N2_CLY_GSM',
'OPERACAO_INV_N2_GENEVA',
'OPERACAO_INV_N2_MICROSIGA_GSM',
'OPERACAO_INV_PORTAB_ESCALONA_FIXA',
'OPERACAO_INV_PORTAB_FIXA',
'OPERACAO_INV_PORTAB_GSM',
'OPERACAO_INV_PORTAB_PROCON_FIXA',
'OPERACAO_INV_PORTAB_PROCON_GSM',
'OPERACAO_INV_PROCON_CLY_FIXA',
'OPERACAO_INV_PROCON_CLY_GSM',
'OPERACAO_SUP_GECO',
'SUPORTE_FIX_CLARIFY',
'SUPORTE_MIGRACAO_CRM_FIX')
            AND ARS.C536870936 >
                    ( (TO_DATE ('24/08/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
                        - TO_DATE ('31/12/1969 21:00:00', 'DD/MM/YYYY HH24:MI:SS'))
                     * 86400)
            AND ARS.C536871173 != 2
            AND ARS.c536871023 = 1
            AND ars.C7 IN (7, 8)
group by Ars.c536871841
Union
SELECT 'Atingida', count(ars.c1),Ars.c536871841 AS AGENTE_RESPONSAVEL
  FROM  t90 ars
 WHERE  1 = 1
            AND Ars.c536871841 in('OPERACAO_INVESTIGACAO_PROB',
'OPERACAO_INV_ESCALONA_CLY_FIXA',
'OPERACAO_INV_MIGRA_CLY_FIXA',
'OPERACAO_INV_N1_BDWEB_FIXA',
'OPERACAO_INV_N1_CLY_FIXA',
'OPERACAO_INV_N1_CLY_GSM',
'OPERACAO_INV_N1_GECO',
'OPERACAO_INV_N2_CLY_GSM',
'OPERACAO_INV_N2_GENEVA',
'OPERACAO_INV_N2_MICROSIGA_GSM',
'OPERACAO_INV_PORTAB_ESCALONA_FIXA',
'OPERACAO_INV_PORTAB_FIXA',
'OPERACAO_INV_PORTAB_GSM',
'OPERACAO_INV_PORTAB_PROCON_FIXA',
'OPERACAO_INV_PORTAB_PROCON_GSM',
'OPERACAO_INV_PROCON_CLY_FIXA',
'OPERACAO_INV_PROCON_CLY_GSM',
'OPERACAO_SUP_GECO',
'SUPORTE_FIX_CLARIFY',
'SUPORTE_MIGRACAO_CRM_FIX')
            AND ARS.C536870936 >
                    ( (TO_DATE ('24/08/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
                        - TO_DATE ('31/12/1969 21:00:00', 'DD/MM/YYYY HH24:MI:SS'))
                     * 86400)
            AND ARS.C536871173 != 2
            AND ARS.c536871023 = 0
            AND ars.C7 IN (7, 8)

group by Ars.c536871841;


/**********************************************************************************************************************************
     Script:QR SIMULA INDICADOR REABERTURA 
         Descrição: 
             Parâmetros:  
                 Retorno: 
                     Data Criação: 
                         Responsável:Marcus Vinicius 
                             *Legenda Nome: VF-Voz Fixa(Terminal/ADSL);PB-PABX;VM-Voz Móvel;DD-Dados;CB-Combos II;PF-Combo I/Grupo-Fone;I-Indifere;O-Outros; 
                                 =============================================================Alteração=============================================================
                                     Data:                                   Responsável: 
                                         OBS: 
                                             **********************************************************************************************************************************/
                                             

SELECT 'Não-Atingida', count(ars.c1),Ars.c536871841 AS AGENTE_RESPONSAVEL
  FROM  t90 ars
 WHERE  1 = 1
            AND Ars.c536871841 in('OPERACAO_INV_ESCALONA_SAC_FIXA',
'OPERACAO_INV_N1_SAC_FIXA',
--'OPERACAO_INV_N2_SAC_FIXA',
--'OPERACAO_INV_N2_SAC_GSM',
'OPERACAO_INV_PROCON_SAC_FIXA')
            AND ARS.C536870936 >
                    ( (TO_DATE ('24/08/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
                        - TO_DATE ('31/12/1969 21:00:00', 'DD/MM/YYYY HH24:MI:SS'))
                     * 86400)
            AND ARS.C536871173 != 2
            AND ARS.c536871023 = 1
            AND ars.C7 IN (7, 8)
group by Ars.c536871841
Union
SELECT 'Atingida', count(ars.c1),Ars.c536871841 AS AGENTE_RESPONSAVEL
  FROM  t90 ars
 WHERE  1 = 1
            AND Ars.c536871841 in('OPERACAO_INV_ESCALONA_SAC_FIXA',
'OPERACAO_INV_N1_SAC_FIXA',
--'OPERACAO_INV_N2_SAC_FIXA',
--'OPERACAO_INV_N2_SAC_GSM',
'OPERACAO_INV_PROCON_SAC_FIXA')
            AND ARS.C536870936 >
                    ( (TO_DATE ('24/08/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
                        - TO_DATE ('31/12/1969 21:00:00', 'DD/MM/YYYY HH24:MI:SS'))
                     * 86400)
            AND ARS.C536871173 != 2
            AND ARS.c536871023 = 0
            AND ars.C7 IN (7, 8)
group by Ars.c536871841

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.