Perhaps the time component of the date is different, hence you are getting
back what looks like duplicate rows but they're not really?
- Max
Martin Anderson
QA Engineer
ProfitLogic
Eleven Cambridge Center
Cambridge, MA 02142
t: 617.218.1946
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard@stripped]
Sent: Thursday, May 09, 2002 12:01 PM
To: mysql@stripped
Subject: MySQL GROUP BY Anomaly?
I have 2 tables with RecordDate in them, one has millions of records, one
has hundreds of records. If I perform the following query on the table with
hundreds;
mysql> select RecordDate
-> from tblInfo
-> WHERE RecordDate BETWEEN '2002-03-04' AND '2002-03-06'
-> GROUP BY RecordDate;
I get three rows back in the result;
+------------+
| RecordDate |
+------------+
| 2002-03-04 |
| 2002-03-05 |
| 2002-03-06 |
+------------+
but if I run this query against the table with millions of records I get (a
small snippet of the results)
| 2002-03-06 |
| 2002-03-05 |
| 2002-03-06 |
| 2002-03-05 |
| 2002-03-06 |
| 2002-03-05 |
| 2002-03-06 |
| 2002-03-05 |
| 2002-03-04 |
+------------+
34164 rows in set (17.78 sec)
Can anyone enlighten me as to what is happening? Both tables are on the same
machine, but the one with millions of records is a MERGE table. If I run the
query against the individual tables in the merge, they return the proper (3
row) result.
Thanks!
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 <mysql-thread108514@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-Martin.Anderson=bodoin.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php