Da du ikke har nævnt det RDBMS, du bruger, er her en forespørgsel, der vil fungere på næsten alle RDBMS:
SELECT aa.User, COUNT(bb.User ) TotalCountFROM (SELECT DISTINCT User FROM TableName) aa LEFT JOIN ( SELECT a.User FROM TableName a INNER JOIN ( SELECT Date, MAX(Value) max_val FROM TableName GROUP BY Date ) b ON a.Date =b.Date AND a.Value =b.max_val ) bb ON aa.User =bb.User GROUP BY aa.User
OUTPUT
╔══════╦════════════╗║ BRUGER ║ TOTALCOUNT ║╠═══════════════ ══╣║ Bob ║ 2 ║║ John ║ 2 ║║ Paul ║ 0 ║╚══════╩═══════════kode