Don't you just need to group on expirationtime?
Something like
select expirationtime, count(expirationtime)
from messages
group by expirationtime;
This will give you a list of the distinct expirationtime and the amount of times they occur.
Of course you'd have to replace the expirationtime in the above statement with your calculation of how it's derived from the database.
Nige
Reputation Points: 13
Solved Threads: 9
Junior Poster in Training
Offline 51 posts
since Nov 2007