Re: sql question

From: ddf <oratune_at_msn.com>
Date: Thu, 10 Sep 2009 12:00:52 -0700 (PDT)
Message-ID: <f3ebf2ce-1252-4367-aef2-f0fe1cfba520_at_r9g2000yqa.googlegroups.com>



Comments embedded.

On Sep 10, 12:41 pm, amy <amykl..._at_gmail.com> wrote:
> I don't seem to be able to figure this out using distinct, group by or
> the having clause. Can someone help?

Show us what you've written and possibly someone can help.

>
> I have a table with the following records. If there are any duplicate
> IDs, I would like to just list the record with the latest timestamp.
>
>         ID NAME  COLDATE
> ---------- ----- --------------------
>          1 G     09-sep-2009 10:20:02
>          1 J     10-sep-2009 10:20:31
>          1 L     10-sep-2009 10:21:00
>          2 H     10-sep-2009 10:20:17
>          3 K     31-aug-2009 10:20:43
>
> The result I'm expecting is
>
>         ID NAME  COLDATE
> ---------- ----- --------------------
>          1 L     10-sep-2009 10:21:00
>          2 H     10-sep-2009 10:20:17
>          3 K     31-aug-2009 10:20:43
>
> Can someone help? thanks in advance.

Obviously your query needs work as I've been able to get your result using group by. I will not post my query as that would be doing your work for you. Post your query and I, or someone, will be happy to provide hints and assistance.

David Fitzjarrell Received on Thu Sep 10 2009 - 14:00:52 CDT

Original text of this message