:) Is this some sort of a joke?

I am grouping using event_id, which makes your query useless because it will
return just the first time row per each event_id.

Thanks anyway. I may have to use second query... :-(


Mihail


----- Original Message -----
From: "Bhavin Vyas" <[EMAIL PROTECTED]>
To: "Mihail Manolov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, July 11, 2002 10:51 PM
Subject: Re: Help - query suggestion needed - interesting case


> How about:
>
>  SELECT
>      event_id, time,
>      count(DISTINCT time) AS Ranges
>  FROM
>      events
>  GROUP BY
>      event_id HAVING Ranges > 1
>
>
> ----- Original Message -----
> From: "Mihail Manolov" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 11, 2002 2:58 PM
> Subject: Help - query suggestion needed - interesting case
>
>
> > Greetings,
> >
> > I am stuck with this problem:
> >
> > I have the following table:
> >
> > event_id   time
> > 100        2000-10-23
> > 100        2000-10-23
> > 101        2000-10-24
> > 101        2000-10-25
> >
> > I need to know all event_id's that have multiple times + time columns.
Is
> it
> > possible to get that result in just one query?
> > The result should be something like this:
> >
> > event_id   time
> > 101        2000-10-24
> > 101        2000-10-25
> >
> >
> > I managed to get all event_id's that have multiple times, but I don't
know
> > how to get the time column in the same query.
> > Here is my current query:
> >
> > SELECT
> >     event_id,
> >     count(DISTINCT time) AS Ranges
> > FROM
> >     events
> > GROUP BY
> >     event_id HAVING Ranges > 1
> >
> > Please help me to find a single query that will return the time column
as
> > well.
> >
> >
> > Mihail



---------------------------------------------------------------------
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