Hi,
I wish to select the value of IDrecord with the oldest date from the table contenttracking. However when using min() and GROUP BY it seems to be mixing different entries in the table.
Table:
Contenttracking
=======================================
ID IDcontent IDrecord time
---------------------------------------
1 329 17 2005-05-29 13:46:49
2 329 24 2005-05-29 20:33:57
=======================================
Query:
SELECT IDcontent, IDrecord, min( time ) AS time
FROM contenttracking
GROUP BY IDcontent
Result host (MySQL 4.?.?):
=======================================
IDcontent IDrecord time
---------------------------------------
329 24 2005-05-29 13:46:49
=======================================
Result on my own testserver (MySQL 4.0.23):
=======================================
IDcontent IDrecord time
---------------------------------------
329 17 2005-05-29 13:46:49
=======================================
In the result on my web host the correct date is selected however the result is merged with a different entry of IDrecord. How do I make sure it returns the value of IDrecord related to the correct time? Or is this simply a bug in a version of MySQL 4?
Regards,
Reimers
I wish to select the value of IDrecord with the oldest date from the table contenttracking. However when using min() and GROUP BY it seems to be mixing different entries in the table.
Table:
Contenttracking
=======================================
ID IDcontent IDrecord time
---------------------------------------
1 329 17 2005-05-29 13:46:49
2 329 24 2005-05-29 20:33:57
=======================================
Query:
SELECT IDcontent, IDrecord, min( time ) AS time
FROM contenttracking
GROUP BY IDcontent
Result host (MySQL 4.?.?):
=======================================
IDcontent IDrecord time
---------------------------------------
329 24 2005-05-29 13:46:49
=======================================
Result on my own testserver (MySQL 4.0.23):
=======================================
IDcontent IDrecord time
---------------------------------------
329 17 2005-05-29 13:46:49
=======================================
In the result on my web host the correct date is selected however the result is merged with a different entry of IDrecord. How do I make sure it returns the value of IDrecord related to the correct time? Or is this simply a bug in a version of MySQL 4?
Regards,
Reimers