I am doing queries that produce a table that looks something like this:

Count   | IP Address    | First Seen    | Last Seen     | Days
5000      10.0.0.1           2005-12-10    2006-04-15      50*
6500      10.0.0.2           2006-04-01    2006-04-06      3**

*So of the 5000 events "count(*) between 2005-12-10 and 2006-04-14"
the count was distributed within 50 distinct days.

**This time the count is still high and it occured within 3 days
between 2006-04-01 and 2006-04-06.

I just cant figure out how to come up with the days part :).

On 4/23/06, John Hicks <[EMAIL PROTECTED]> wrote:
> Paul Halliday wrote:
> > I am trying to formulate a query that will increment if a condition is true.
> >
> > For example, if I do a select (just let me know if there was data on
> > this day, if so increment count by 1 and check the next day) where
> > timestamp between jan and feb.
>
> Could you be a bit more specific?
>
> Where do you want to store the count?
>
> What do you mean by "if there was data on this day"? Does the design of
> the table anticipate no more than one record per day? Does each record
> correspond to a single day?
>
> --John
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to