I try to filter my data in a simple way:
SELECT * FROM INFO_CA
WHERE DATE_FACT > TO_DATE('20160101', 'YYYYMMDD')
AND ACCOUNT_SOC <> 'BELGIUM'
This query return 111 926 records.
- There're 10 457 262 records in my table INFO_CA after filtering on the date.
- There're 296 records with 'BELGIUM' in the column ACCOUNT_SOC
- There're 111 926 records with something different than BELGIUM in ACCOUNT_SOC
- And there're 10 345 040 with null value in ACCOUNT_SOC.
If I use this 2nd query, I have what I expect (10 456 966 records = 10 345 040 null + 111 926 with something else than BELGIUM)
SELECT * FROM INFO_CA
WHERE DATE_FACT > TO_DATE('20160101', 'YYYYMMDD')
AND (ACCOUNT_SOC <> 'BELGIUM' OR ACCOUNT_SOC IS NULL)
I'm using Oracle 12 (SQL Developer) + Talend. Even in Talend my first query don't return the null values.
So why ? Why my first query only returns records with a value different from BELGIUM or null. Why do I have to specify that I want the records with ACCOUNT_SOC null ?
The datatype of ACCOUNT_SOC is VARCHAR2(255 BYTE).
Thanks :)