select UserName ,Max(LoginTime),count(1) from LoginLog group by UserName
只 group by UserName就行 可以得到LoginTime