DELETE FROM DC2_ILS.OR_100 WHERE PV_USER = '093';
commit;
INSERT INTO DC2_ILS.OR_100 (PV_KEY,PV_USER,PV1)
SELECT LPAD(TO_CHAR(ROWNUM),20,0),TABLE_SELECT.* FROM (
SELECT '093',COUNT(*)
FROM
ILS_SEIKYU.H_BILL@ILS_SEIKYU T001
LEFT OUTER JOIN ILS_SEIKYU.M_DATE@ILS_SEIKYU T003 ON
 T001.BILLDate=T003.YYYYMMDD
LEFT OUTER JOIN ILS_SEIKYU.M_CUST@ILS_SEIKYU T002 ON
 T001.CUSTCode=T002.CUSTCode
WHERE
 T003.YYYYMM BETWEEN '20250401' AND '20260331'
) TABLE_SELECT
;
commit;
EXIT;


