The Oracle database fuzzy query statement is a result that is easy to ignore: the problem of empty records

Source: Internet
Author: User

The Oracle database fuzzy query statement is easy to ignore: the cause of the null record problem: the SQL statement is as follows: select count (*) from test; the result is 1390. select count (*) from test where bb not like '% disable %' result 393. in the actual browsing process, it is found that the result set is not disabled and there are certainly more than 393 records.
Process: 1. First, we suspect that the character set problem may be that the client character set does not match the server character set. After the preceding SQL statement is used on another machine, www.2cto.com returns the same result with similar replications. 2. I still suspect that it is a character set problem. I have not found the real cause of the problem, and almost went crazy. 3. I accidentally found that many bb fields are empty. After careful analysis, I found that bb not like '% disabled %' does not match null records, so I changed it to select count (*) from test where bb not like '% disabled %' or bb is null, 1356 is returned. Conclusion:
Fuzzy match is not often used, so it will lead to careless use, and eventually lead to human madness.
Author: noodle123

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.