MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Paul Halliday Date:April 23 2006 9:11pm
Subject:Re: If exists query.
View as plain text  
I am doing queries that produce a table that looks something like this:

Count   | IP Address    | First Seen    | Last Seen     | Days
5000           2005-12-10    2006-04-15      50*
6500           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 <johnlist@stripped> 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
If exists query.Paul Halliday21 Apr
  • Re: If exists query.John Hicks23 Apr
    • Re: If exists query.Paul Halliday23 Apr
Re: If exists query.Paul Halliday24 Apr
  • Re: If exists query.Shawn Green24 Apr
  • Re: If exists query.Peter Brawley24 Apr