Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Distinct not working when convert DATE using TO_CHAR

Re: Distinct not working when convert DATE using TO_CHAR

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 21 Dec 2005 05:24:01 -0500
Message-ID: <8dadndTfq_zfsDTeRVn-sg@comcast.com>

"SunScreen" <alampro_at_yahoo.com> wrote in message news:1135152639.676245.107050_at_g49g2000cwa.googlegroups.com...
> Following is the data:
>
> Number Date
> ---------- -------------------
> 26 12/19/2005 13:57:05
> 26 12/19/2005 13:57:07
> 27 12/19/2005 13:57:29
> 27 12/19/2005 13:57:31
> 28 12/19/2005 13:57:54
> 28 12/19/2005 13:57:55
>
> and the actual query:
>
> select Field1 "Number", to_char(time, 'MM/DD/YYYY HH24:MI:SS') "Date"
> from audit_iedata where ( time >= to_date('19-DEC-2005 13:00',
> 'DD-MON-YYYY:HH24:MI') and time <= to_date('19-DEC-2005 14:00',
> 'DD-MON-YYYY:HH24:MI'));
>
> How can I get only first occurence of Field1 ? ie:
>
> Number Date
> ---------- -------------------
> 26 12/19/2005 13:57:05
> 27 12/19/2005 13:57:29
> ....
>

did you try a GROUP BY query as previously suggested?

++ mcs Received on Wed Dec 21 2005 - 04:24:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US