我有多个请求,我想做一个简单的请求
INSERT INTO SERVICEPAYANT_CLIENT (RE_ID, TYPE_DONNEES)
SELECT CLIENT_ID, 160 AS TYPE_DONNEES
FROM REFERENTIEL r, CLIENT_APPLICATIF ca
WHERE r.ID = ca.ID_REFERENTIEL
AND r.TYPE=1
AND NOT EXISTS (
SELECT * FROM SERVICEPAYANT_CLIENT sp
WHERE sp.RE_ID = CLIENT_ID AND TYPE_DONNEES = 160)
GROUP BY CLIENT_ID
HAVING COUNT(*)>0;
INSERT INTO SERVICEPAYANT_CLIENT (RE_ID, TYPE_DONNEES)
SELECT CLIENT_ID, 161 AS TYPE_DONNEES
FROM REFERENTIEL r, CLIENT_APPLICATIF ca
WHERE r.ID = ca.ID_REFERENTIEL
AND r.TYPE=1
AND NOT EXISTS (
SELECT * FROM SERVICEPAYANT_CLIENT sp
WHERE sp.RE_ID = CLIENT_ID AND TYPE_DONNEES = 161)
GROUP BY CLIENT_ID
HAVING COUNT(*)>0;
INSERT INTO SERVICEPAYANT_CLIENT (RE_ID, TYPE_DONNEES)
SELECT CLIENT_ID, 162 AS TYPE_DONNEES
FROM REFERENTIEL r, CLIENT_APPLICATIF ca
WHERE r.ID = ca.ID_REFERENTIEL
AND r.TYPE=1
AND NOT EXISTS (
SELECT * FROM SERVICEPAYANT_CLIENT sp
WHERE sp.RE_ID = CLIENT_ID AND TYPE_DONNEES = 162)
GROUP BY CLIENT_ID
HAVING COUNT(*)>0;
INSERT INTO SERVICEPAYANT_CLIENT (RE_ID, TYPE_DONNEES)
SELECT CLIENT_ID, 163 AS TYPE_DONNEES
FROM REFERENTIEL r, CLIENT_APPLICATIF ca
WHERE r.ID = ca.ID_REFERENTIEL
AND r.TYPE=1
AND NOT EXISTS (
SELECT * FROM SERVICEPAYANT_CLIENT sp
WHERE sp.RE_ID = CLIENT_ID AND TYPE_DONNEES = 163)
GROUP BY CLIENT_ID
HAVING COUNT(*)>0;