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 -> Distinct not working when convert DATE using TO_CHAR

Distinct not working when convert DATE using TO_CHAR

From: SunScreen <alampro_at_yahoo.com>
Date: 20 Dec 2005 07:02:28 -0800
Message-ID: <1135090948.318228.16790@g14g2000cwa.googlegroups.com>


Hi all,

First I used this query:
SELECT DISTINCT Field1, Field2 FROM Table; The results was distinct records. So far so good. Note that Field2 is DATE datatype.

Then I used this one:
SELECT DISTINCT Field1, to_char(Field2, 'MM/DD/YYYY HH24:MI:SS') "Date" FROM Table;
The result was all records, that is not distinct records.

Any thoughts?

Thanks in advance
SunScreen

keywords: DISTNCT; SELECT; TO_CHAR; DATE; DATATYPE Received on Tue Dec 20 2005 - 09:02:28 CST

Original text of this message

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