Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Distinct not working when convert DATE using TO_CHAR
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
![]() |
![]() |