Bug #11682 DISTINCT(DATE_FORMAT())
Submitted: 1 Jul 2005 7:22 Modified: 12 Jul 2005 12:27
Reporter: Rambabu k Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:3.23.49 OS:Windows (Windows NT)
Assigned to: Geert Vanderkelen CPU Architecture:Any

[1 Jul 2005 7:22] Rambabu k
Description:
Iam writing a Query to Select a Distinct Date depending on the format.

When the Following Query is Run in MySQL 4.0 It is working fine and displaying distinct dates.
When the same query is executed in MySQL 3.23.49. It is not fetching the distinct dates it is displaying duplicates date. What is the Problem . Is it the problem with version of MySQL? If so from which version it will be supported.

The Query I executed is:

SELECT DISTINCT DATE_FORMAT(A.RECORDEDDATE,'%Y-%m-%d') AS RECORDEDDATE FROM table1 AS A, table2 AS AK WHERE AK.KEYID = 24 AND A.ARTICLEID = AK.ARTICLEID ORDER BY A.RECORDEDDATE DESC

How to repeat:
check it in earlier versions

Suggested fix:
I think the problem is with MySQL Versions only. Is it So?
[12 Jul 2005 12:27] Geert Vanderkelen
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

Works fine in 3.23.58, 4.0.24, 4.1.12, 5.0.7

create table t1 ( d datetime );
insert into t1 values (now()+ interval 1 day);
insert into t1 values (now()+ interval 4 day);
insert into t1 values (now()+ interval 6 day);
insert into t1 values (now()+ interval 6 day);
insert into t1 values (now()+ interval 4 day);
select distinct d from t1;
select distinct date_format(d,"%Y-%m-%d") from t1;

Best regards,
Geert