Let me try simplifying the problem even more. Bob and Tom change their favorite color. Here's the database in comma deliminted form. The id field is the primary key. I'm trying to simply return unique contact id's (that part is easy with group) and list the last entry for each user. prmFollowup (table data) field names in first row. id, contact, favColor 1, Bob, red 2, Tom, green 3, Tom, red 4, Bob, blue Here's the first PHP Query SELECT contact, favColor FROM prmFollowup GROUP BY contact ORDER BY id DESC Here is the result: prmCustID in order and the first record ID for favorite color. Bob, red Tom, green No duplicate customer ID's, as expected, but the favorite colors are out of order. ORDER BY id isn't working because of the GROUP function. Take out the GROUP BY method and I get the proper order for favorite colors, latest color choice first, but I have duplicates Bob, red Bob, green Tom, blue Tom, red What I need is the just the last favColor for each contact. Bob, red Tom, blue I've tried a bunch of options including HAVING and DISTINCT with no success. This has got to be a commonly needed query for a relational database. Any help would be appreciated.
... View more