Do you mean that you want to find the number of rows (groups) where you have two or more attributes that are identical? As below?
create table test
(
a varchar(10) null,
b varchar(10) null,
c varchar(10) null,
d varchar(10) null,
e varchar(10) null,
f varchar(10) null
)
insert into test (a,b,c,d,e,f) values ('fred','jim','sheila','wibble','wobble','womble')
insert into test (a,b,c,d,e,f) values ('fred','ethel','sheila','wibble','wobble','womble')
insert into test (a,b,c,d,e,f) values ('fred','jim','sheila','wibble','wobble','womble')
insert into test (a,b,c,d,e,f) values ('fred','jim','sheila','wibble','wobble','womble')
insert into test (a,b,c,d,e,f) values ('fred','ethel','sheila','wibble','wobble','womble')
insert into test (a,b,c,d,e,f) values ('fred','jim','sheila','wibble','wubble','womble')
insert into test (a,b,c,d,e,f) values ('fred','albert','sheila','wibble','wubble','womble')
insert into test (a,b,c,d,e,f) values ('fred','jim','sheila','wibble','wobble','womble')
select
count(*) as groupCount,
a,b,c,d,e,f
from test
group by
a,b,c,d,e,f
groupCount a b c d e f
1 fred albert sheila wibble wubble womble
2 fred ethel sheila wibble wobble womble
4 fred jim sheila wibble wobble womble
1 fred jim sheila wibble wubble womble
(4 row(s) affected)
select
count(*) as groupCount,
b,c,d
from test
group by
b,c,d
groupCount b c d
1 albert sheila wibble
2 ethel sheila wibble
5 jim sheila wibble
(3 row(s) affected)