I have 1 table that has the following columns
From this table I want to
a) group the records by clientid
b) get the latest entry where ref = 3 (the latest entry can be got if you run a max on the id column)
so if I ran with the records below then the results will be just 1 entry that is highlighted.