In reply to ThunderCat:
I just thought wouldn't it be great if UKC had an SQL playground where we could try out these things.
Lo and behold I found one at
http://sqlfiddle.com/ <-- it's brill!
Pasting the raw data into "Text to DLL" tool
AppID CustID Name Date Value
1 1 Paul 01/01/2012 100
2 1 Paul 01/05/2012 200
3 1 Paul 01/01/2013 50
4 2 John 04/05/2012 100
5 2 John 05/08/2012 200
6 2 John 05/10/2012 300
7 3 George 02/03/2010 45
8 3 George 01/10/2012 45
9 3 George 01/02/2013 10
10 4 Ringo 05/06/2012 75
11 4 Ringo 05/07/2012 75
12 4 Ringo 01/11/2012 2
I got
CREATE TABLE Table1
(`AppID` int, `CustID` int, `Name` varchar(6), `Date` datetime, `Value` int)
;
INSERT INTO Table1
(`AppID`, `CustID`, `Name`, `Date`, `Value`)
VALUES
(1, 1, 'Paul', '2012-01-01 00:00:00', 100),
(2, 1, 'Paul', '2012-01-05 00:00:00', 200),
(3, 1, 'Paul', '2013-01-01 00:00:00', 50),
(4, 2, 'John', '2012-04-05 01:00:00', 100),
(5, 2, 'John', '2012-05-08 01:00:00', 200),
(6, 2, 'John', '2012-05-10 01:00:00', 300),
(7, 3, 'George', '2010-02-03 00:00:00', 45),
(8, 3, 'George', '2012-01-10 00:00:00', 45),
(9, 3, 'George', '2013-01-02 00:00:00', 10),
(10, 4, 'Ringo', '2012-05-06 01:00:00', 75),
(11, 4, 'Ringo', '2012-05-07 01:00:00', 75),
(12, 4, 'Ringo', '2012-01-11 00:00:00', 2)
;
I could then "Build Schema" and run the query on the table
SELECT MAX(AppID), CustID, Name, MAX(Date), Value FROM Table1 GROUP BY CustID
to obtain
MAX(APPID) CUSTID NAME MAX(DATE) VALUE
3 1 Paul January, 01 2013 00:00:00+0000 100
6 2 John May, 10 2012 01:00:00+0000 100
9 3 George January, 02 2013 00:00:00+0000 45
12 4 Ringo May, 07 2012 01:00:00+0000 75
I suspect my query relies on AppID being an autoincrement PK so MAX(DATE) corresponds to MAX(AppID) for that CustID.
In conclusion, my query may be wrong but
http://sqlfiddle.com/ is brilliant.