drop table DLAB_PROGRAMADATOSVPC.NOMBRE_TABLA;
CREATE MULTISET TABLE DLAB_PROGRAMADATOSVPC.NOMBRE_TABLA as (
WITH 
VAR as
(
--sel max(a.FecInformacion_Dt) FECHA 
--, CAST( (CAST (max(a.FecInformacion_Dt) AS FORMAT 'YYYYMM')) AS CHAR(6)) PERIODO
--from E_DW_VIEWS.V_MST_SDA_SOLICITUD a
--where a.FecInformacion_Dt = (SELECT MAX(FecInformacion_Dt) FROM  E_DW_VIEWS.V_MST_SDA_SOLICITUD WHERE FecInformacion_Dt>=ADD_MONTHS(CURRENT_DATE,-7)) --TO_DATE('20230531','YYYYMMDD')--cambiar a cierre de mes
)
-- QUERY
) WITH DATA PRIMARY INDEX (LLAVE1, LLAVE12);

Add a code snippet to your website: www.paste.org