您可以通过计数进行分组,还可以得到组的最后一项,例如:
SELECT user, COUNT(user) AS count, MAX(id) as last FROM request GROUP BY user