Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Find the first record, for every day
On 21.12.2005 10:48 ohahaahr_at_hotmail.com wrote:
> Hi !
>
> I have a tricky problem, and i can't solve it.
>
> I have the following table T1, with the following fields and records:
>
> Date_ Status
> ---------- -------
> 2005-12-01 2
> 2005-12-01 1
> 2005-12-17 1
> 2005-12-18 2
> 2005-12-18 10
>
> I want to generate on output, that gives me the "first" record every
> day. The output should look like this:
>
>
> Date_ Status
> ---------- -------
> 2005-12-01 2
> 2005-12-17 1
> 2005-12-18 2
>
>
> This appears to be a very simple problem, but i can't find the
> solution. Can anybody give me a hint ? (I have tried with rownum, but
> that didn't work).
>
The question is: what is the difference between the date 2005-12-01 with Status 2 and the date for 2005-12-01 with the status 1. How do you distinguish between the two? Which one is the "first", you don't seem to have an additional sorting criteria that could be used to find the "first" of a given day.
Thomas
-- It's not a RootKit - it's a SonyReceived on Wed Dec 21 2005 - 04:08:16 CST