count without group

前端 未结 6 2034
眼角桃花
眼角桃花 2020-12-14 01:19

I have one table named GUYS(ID,NAME,PHONE) and i need to add a count of how many guys have the same name and at the same time show all of them so i can\'t group them. exampl

6条回答
  •  有刺的猬
    2020-12-14 01:47

    select id, name, phone,(select count(name) from users u1 where u1.name=u2.name) count from users u2
    

提交回复
热议问题