select id,t1.name,t2.count
from 表 t1 left join (select name,count(1) count
from 表
group by name) t2 on t1.name=t2.name
limit 0,5
select * ,count(*) from user where name='张三' limit 0,5;
试试这样