An easily overlooked result of the Oracle database fuzzy query statement: the problem of empty records
the
reason:
the
Use the SQL statement as follows:
the
select count(*) from test;
the
The result is 1390.
select count(*) from test where bb not like ‘%disable%’
the
The result is 393.
the
During the actual browsing process, it is found that the non-disabled result set must exceed 393 records.
the
process:
the
1. First suspect the character set problem, maybe the client character set does not match the server character set.
www.2cto.com
After using the above SQL statement on someone else’s machine, repeated and similar substitutions, the results are the same.
the
2. I still suspect that it is a problem with the character set, and I am almost crazy because I have not found the real cause of the problem.
the
3. I accidentally found that many of the bb fields are empty. After careful analysis, I found that bb not like ‘%disabled%’ will not match empty records, so I changed it to
the
select count(*) from test where bb not like ‘%disable%’ or bb is null
the
The result is 1356.
the
Conclusion:
the
Because fuzzy matching is not used frequently, it will lead to sloppy use, which will eventually lead to manpower going crazy.
the
the
Author noodle123
An easily overlooked result of the Oracle database fuzzy query statement: the problem of empty records
This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/an-easily-overlooked-result-of-the-oracle-database-fuzzy-query-statement-the-problem-of-empty-records/