If I have 4,000,000 records, and I just want to make sure that the last 100 
records do not contain a certain value,  ... how can I efficiently 'count' 
the number of times in the LAST 100 records that a specific condition exists?

As an example,

mysql> select COUNT(*) from Log WHERE LogIP="10.0.0.22" ORDER BY LogID 
LIMIT 100;

The above syntax actually COUNTs all the occurances, not just the COUNT 
from the last 10 records...

My goal is to check for specific conditions on ONLY the last couple 
records, so that the entire table does not have to be reviewed.

Any thoughts, ideas or comments?







---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to