RE: Stupid GROUP BY question

2009-09-25 Thread Gavin Towey
nt: Friday, September 25, 2009 1:28 PM To: mysql@lists.mysql.com Subject: Stupid GROUP BY question It must be too late in the week… Suppose table Cust has one field, CustID. Suppose table Notes has four fields: NoteID (unique), CustID, NoteTime, and NoteText. A customer can have zero or more

Re: Stupid GROUP BY question

2009-09-25 Thread Peter Brawley
Jerry, I want to find the newest note (if any) for each customer. See "Within-group aggregates" at http://www.artfulsoftware.com/infotree/queries.php PB - Jerry Schwartz wrote: It must be too late in the week... Suppose table Cust has

Stupid GROUP BY question

2009-09-25 Thread Jerry Schwartz
It must be too late in the week… Suppose table Cust has one field, CustID. Suppose table Notes has four fields: NoteID (unique), CustID, NoteTime, and NoteText. A customer can have zero or more notes. Now here’s the seemingly simple problem that I’m trying to solve: I want to find the new