The first few days in the project, do the data import, found not in and in the check out the number of bars is not complementary. ATABLE2 some of the records in ATABLE3 do not exist, but not in when the record is not found.
CREATE TABLE ATABLE2
("Mrid" VARCHAR2 (BYTE)
)
CREATE TABLE ATABLE3 "
("Mrid" VARCHAR2 (BYTE)
)
The query statements are as follows
Select COUNT (*) from Atable2 where Mrid is not in (select Mrid from Atable3), the query result is 0.
After several checks, the problem of not in and Null was found. There is a mrid null record in the Atable3 table, at which time not the in query does not have a value.
The modification scenario is as follows: adding non-null filtering in subqueries
Select COUNT (*) from Atable2 where Mrid not in (select Mrid from Atable3 where mrid are NOT null)
Complete!
The ps:count statistic function does not apply to null values and requires count (*).
MYSQL not-in sub-connection query does not have a value problem