Today while I was writing a complex query, accidently I found that even I have set LIMIT
in my query MySQL server returns the total number of rows for COUNT
.
Example:
SELECT COUNT(*) FROM `log` LIMIT 10;
Output:
5219
But if I run the query without COUNT
it returns only 10 rows. My question is,
Why does MySQL ignore
LIMIT
when theCOUNT
is present?