hi.

okay...that's a different story.
in oracle that could be done with a corellated subquery...in mysql there
really is no easy way to do something like this.
you could theoretically copy your information to a temporary table, and then
select it out, but other than that, it seems you're out of luck.
otherwise, you'll have to do this in 2 queries within your app.

if anyone can point out something i'm overlooking (either re: your request
or mysql), i'd be interested to know.

-ravi.

-----Original Message-----
From: Rodrigo Gonzalez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 11:41 AM
To: Ravi Raman; [EMAIL PROTECTED]
Subject: Re: GROUPING


I did this, but there is a problem....
I have to select all fields from the record returned, not just id and start,
i need the other fields from the record with max start do you understand?

----- Original Message -----
From: "Ravi Raman" <[EMAIL PROTECTED]>
To: "Rodrigo Gonzalez" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 12:37 PM
Subject: RE: GROUPING


> hi.
>
> select id, max(start) from your_table group by id;
>
> HTH.
> -ravi.
>
> -----Original Message-----
> From: Rodrigo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 10:57 AM
> To: [EMAIL PROTECTED]
> Subject: GROUPING
>
>
> Hi,
>
> I have to do a query but i don't know how to do this...
>
> I have this table
>
> id int
> start time
> stop time
> ...
> There are 2 to 4 rows for each id
>
> I have to select one row for each id where start is the max value between
> all rows with this id
>
> If you have an idea please let me know
>
> Thanks
>
>



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