I have never encountered the select top problem in the ACCESS database before. Today I have encountered this problem.
Example: Select top 6 ID, title from table where ispass = 1 order by orderid
In the previous statement, only 6 data records are returned. After updating some data records, more than 6 data records are returned.
Changed to: Select top 6 ID, title from table where ispass = 1 order by ID
Then, only 6 results are returned. After checking the information, you can find the problem: the orderid of the sorting field has the same record, whileTop predicates are not selected in the same value (top cannot select the top order you want from the same value).
Corrected SQL statement: Select top 6 ID, title from table where ispass = 1 order by orderid, Id DESC
Done!
Conclusion: When the select top statement is used in access, the sorted field values cannot be repeated. If records with the same value exist, corresponding records are returned in this statement. Solution: Add a sorting field.