Saya yakin Anda mencoba memfilter nilai seperti 07-AUG-15
tetapi pola suka Anda mengatakan 07_%
. Seharusnya
gal.name not like '07-%'
Juga, bagian terakhir Anda seperti yang ditunjukkan di bawah ini tidak masuk akal; alih-alih Anda harus memasukkan kondisi tersebut dalam kueri utama WHERE
ayat.
and ( exists (select FIRSTNAME
from TCPD_PERSONEL_COPY
where (gal.name not like '07_%' AND
gal.name not like 'TR_%' AND
gal.name not like 'ST_%' AND
gal.name not like 'KB_%' AND
gal.name not like 'HS_%' AND
gal.name is not null))
SELECT
. Anda seharusnya terlihat seperti
SELECT SUBSTR(NAME, 1, 50),SUBSTR( GIVEN_NAME, 1, 50), DEPARTMENT, PHONE, SUBSTR(MAIL, 1, 100), SUBSTR(LOGIN, 1, 255), SYSDATE
FROM gal
WHERE ( NOT EXISTS (SELECT EMAIL1
FROM TCPD_PERSONEL_COPY
WHERE GAL.mail = TCPD_PERSONEL_COPY.email1)
OR NOT EXISTS (SELECT userid
FROM TCPD_PERSONEL_COPY
WHERE gAL.LOGIN = TCPD_PERSONEL_COPY.userid))
AND GAL.mail IS NOT NULL AND GAL.COUNTRY='GERMANY'
AND ( gal.name not like '07_%' OR
gal.name not like 'TR_%' OR
gal.name not like 'ST_%' OR
gal.name not like 'KB_%' OR
gal.name not like 'HS_%' OR
gal.name is not null);