Re: duplicate rows problem with a twist

From: Kishore H <khejmady_at_melstar.com>
Date: 16 Jan 2003 02:52:52 -0800
Message-ID: <ed8ee3e4.0301160252.65c6d60e_at_posting.google.com>


Try this

select count(*)
from ( select field1, field2

       from table
       group by field1, field2
       having count(*) > 1
     )

/

Regards
Kishore H.
"Brian E Dick" <bdick_at_cox.net> wrote in message news:<n7kV9.77524$t06.3610483_at_news2.east.cox.net>...
> In the right spirit, Jim.
>
> select count(count(*)) from my table group by field1, field2 having count(*)
> > 1
>
> "Jim Kennedy" <kennedy-down_with_spammers_at_attbi.com> wrote in message
> news:GefV9.61069$Dn.10821_at_sccrnsc03...
> > How's this:
> > select count(count(*)) from my table group by field1, field2
> > Jim
> >
> > --
> > Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
> > with family. Remove the negative part, keep the minus sign. You can
 figure
> > it out.
> > "s rao" <sujayrao2002_at_yahoo.com> wrote in message
> > news:699596f3.0301150537.184722b0_at_posting.google.com...
> > > hi all,
> > >
> > > how do i get the count of the total number of rows duplicated in a
> > > table. i dont want to print all the rows and the duplicate counts of
> > > each rows. i just want the count of the result.
> > >
> > > for example if two fields of the table are like this
> > > Field1 Field 2
> > > a b
> > > a b
> > > a b
> > > c d
> > > c d
> > > e f
> > >
> > > then i want the result to print 2
> > > and NOT
> > > a b 3
> > > c d 2
> > >
> > > thanks
> >
> >
Received on Thu Jan 16 2003 - 11:52:52 CET

Original text of this message