I don't want to doubt you :-) but can you show us a select including the
time component?  I don't know how date comparison works in MySQL but here is
a test I ran in Oracle.  I inserted some dates into a table using sysdate
which include time information and inserted more records using
to_date('2002-05-09', 'dd-mon-yyyy') which does not include time
information.  These records are shown below.  Now if you run the two queries
you mentioned you also get records back because date comparison that does
noy explicitly include a time assumes 12:00:00.  I am thinking that if you
lool at your date fields closer you will find that some have different
timestamps.

I could be wrong but it's certainly a quick and easy comfirmation for you to
try.

  1* select to_char(martin, 'dd-mon-yyyy hh:mi:ss') from martin
SQL> /

TO_CHAR(MARTIN,'DD-M
--------------------
09-may-2002 02:28:14
09-may-2002 02:28:19
09-may-2002 02:28:20
09-may-2002 02:28:20
09-may-2002 02:28:21
09-may-2002 12:00:00
09-may-2002 12:00:00
09-may-2002 12:00:00
09-may-2002 12:00:00
09-may-2002 12:00:00

10 rows selected.

SQL> select * from martin where martin = '2002-05-09';

MARTIN
----------
2002-05-09
2002-05-09
2002-05-09
2002-05-09
2002-05-09

SQL> select * from martin where martin > '2002-05-09';

MARTIN
----------
2002-05-09
2002-05-09
2002-05-09
2002-05-09
2002-05-09

Martin Anderson
QA Engineer
ProfitLogic
Eleven Cambridge Center
Cambridge, MA 02142
t: 617.218.1946


-----Original Message-----
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 09, 2002 1:23 PM
To: [EMAIL PROTECTED]
Subject: RE: MySQL GROUP BY Anomaly?


[snip]
Perhaps the time component of the date is different, hence you are getting
back what looks like duplicate rows but they're not really?
[/snip]

The time components are all the same. And if I say this in my query;

WHERE RecordDate = '2002-03-04' , it works (returns one row of data)

or if I do;

WHERE RecordDate > '2002-03-04' ,       it works

I am stumped.

Jay



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to