How would you make it so that the entire row is the one that contains the earliest data field ?
----- Original Message ----- From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 12, 2004 2:47 PM
Subject: RE: SELECT earliest unique records
[snip] I have a table that contains a item_id field (non unique index) id field and a date field.
How would you go about selecting rows from the table (single row for each item_id with the earliest date field for that item_id).
If I use group by item_id the date field will be whatever the first date
field it had, so ordering by it at that point will not yeald the intended results. [/snip]
Use MAX(date field)
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]