Simple answer:
If any SQL query is allowed, you can also just artificially boost the record count by doing something like a UNION SELECT myKnownRecord at the end.
More general answer:
This issue is part of a larger family of strategies known as de-anonymization. One of the methods for avoiding unintended disclosure when other methods like k-anonymity enforcement, aggregation, rounding, and blurring or coarsening data don't work is suppressing results for small groups.
The biggest reason this method of restricting queries that result in small ranges doesn't work universally is that there are many other ways to get a complete picture of what's going on even if you don't look at results with less than 5 entries.
Suppose we have different criteria a,b, and c. The set A is the set of all records that match criteria a, the set A ∩ B is the set of all records that match criteria a and b (corresponding to an SQL JOIN or similar operation), etc.
Let's suppose that A ∩ B ∩ C is a small enough set to identify the records for our target (A ∩ B ∩ C has less than five elements). However, a minimum record criteria restricts us from directly viewing A ∩ B ∩ C. However, we could view A ∩ B, A ∩ C, and A ∩ B, then manually do a union of two of those to get a union the union we want A ∩ B ∩ C. This is however, assuming that the result you want is unique. If the records are not unique (say they're letter grades, income categories, yes/no answers, or an average based on the returned records), your can't do manual joins and I can't think of a universal way to get the exact values.
Unions (outer joins) could also be used on occasion to cricumvent this protection strategy. If you know your target is one of the few members of set A (perhaps because the results for A were hidden) we could look at aggregate results for A U C and any results near 0% or 100% would apply to our target in A.
Another way that this protection can be circumvented is by using other results to subtract our way to the result we want. If we know there are 120 out of 160 people have passing grades in set A, and 120 out of 157 have passing grades in A ∩ B, then even if A ∩ B' (A and not B) is hidden due to having too few results we already know that no one is passing in that group. This can usually be avoided if we avoid disclosure of how many entries are in each set, by rounding percentages aggressively, or grouping percentages into categories ("< 5%" or 3% instead of 3.1%).
To use an example (modified from the one provided by National Center for Education Statistics), say a school discloses that only one male American Indian/Alaskan Native student was enrolled in 2010. If the school discloses the graduation rate for this demographic, the individual's privacy has been compromised. The student's privacy could also be violated if complementary groups can be used to get a complete picture of the student, like the graduation rate being 0% for American Indian/Alaskan Natives or that all other demographics total up to 100% of graduates.
To provide context, L. Sweeney at Carnegie Mellon did a study that concluded: "It was found that combinations of few characteristics often combine in populations to uniquely or nearly uniquely identify some individuals. Clearly, data released containing such information about these individuals should not be considered anonymous. Yet, health and other person-specific data are publicly available in this form. Here are some surprising results using only three fields of information, even though typical data releases contain many more fields... even at the county level, {county, gender, date of birth} are likely to uniquely identify 18% of the U.S. population. In general, few characteristics are needed to uniquely identify a person." Similar personal identification and de-anonymization has been proved for a database of credit card transactions that had been naively anonymized. So even such simple queries as "all records with this gender, DOB, and geographic area" or "people who visited these four shops recently and spent about $50" are likely to seriously compromise privacy. Because these kinds of records like birth date and city can be combined to de-anonymize data, HIPAA, FERPA, and similar standards are written to strictly limit any kind of disclosure of this information.
In summary, as Anupam Datta of CMU said, "Naïve anonymization mechanisms do not work."