query indicadores renta - tableros

mail@pastecode.io avatar
unknown
sql
2 years ago
672 B
7
Indexable
Never
SELECT PERIODO, BANCA, ZONAL, COD_SECT_UNIQ, CODIGO_JEFE, ACCOUNT_OFFICER, EJECUTIVO, TIPO_COLOCACION, PRODUCTO, CARTERA, ID_GRUPO_INOF, GRUPO_INOF,
SUM(SAL_PROM_SOL)/1000 AS SAL_PROM_SOL,
SUM(INT_SOL)/1000 AS INT_SOL,
SUM(FSD_SOL)/1000 AS FSD_SOL,
SUM(FTP_SOL)/1000 AS FTP_SOL,
SUM(RF_SOL)/1000 AS RF_SOL,
SUM(INOF)/1000 AS INOF
FROM RENTABILIDAD_TOTAL
WHERE PERIODO > ('202100')
AND TIPO_COLOCACION NOT IN ('REACTIVA')
AND BANCA IN ('BC', 'BEP', 'BEL', 'BE')
AND CARTERA IN ('NEGOCIOS')
GROUP BY PERIODO, BANCA, ZONAL, COD_SECT_UNIQ, CODIGO_JEFE, ACCOUNT_OFFICER, EJECUTIVO, TIPO_COLOCACION, PRODUCTO, CARTERA, ID_GRUPO_INOF, GRUPO_INOF
ORDER BY PERIODO ASC