number of row that repeated
table tbl1
field id,name
id=1 name=a
id=1 name=a
id=1 name=w
id=1 name=f
id=2 name=c
id=2 name=a
how can get number of field repeated. i开发者_运维知识库d=1 ,name=a ==>2
it's simple
select
id,
name,
count(*)
from
table
group by
id, name
精彩评论