Re: SQL Duplicates ?

From: Robin Boscia <rboscia_at_att.com>
Date: Mon, 20 Nov 2000 10:24:58 -0700
Message-ID: <8vbm7d$jhm2_at_kcweb01.netnews.att.com>


Eric,
[Quoted]   Thanks for your sql answer. This statement gives me the counts, but I also need to display the ticket # of all the duplicates in the output. If I select telephone_number, ticket, count(ticket#) it does not work. What am I doing wrong? Or better yet, what do I need to do right?

Thanks
Robin

"Eric Givler" <egivler_at_flash.net> wrote in message news:D5fQ5.562$6W1.55314_at_news.flash.net...
> select telephone_number, count(ticket#)
> from table
> group by telephone_number
> having count(ticket#) > 1
>
> Boscia <rwboscia_at_worldnet.att.net> wrote in message
> news:B634B0E6.890B%rwboscia_at_worldnet.att.net...
> > I am a newbie when it comes to SQL, so I am not sure how to obtain the
> > following.....
> >
> > I have a table that has customer telephone numbers in it and a table
 that
> > has ticket #'s in it.
> > I want to do a query that shows all the ticket #'s that have referenced
> > duplicate telephone numbers. This is how I want to output to appear....
> >
> >
> > Telephone Number Ticket #
> >
> > 123-456-7890 1234
> > 1235
> > 1236
> >
> >
> > Count 3 duplicates
> > for TN 123-456-7890
> >
> >
> > TN Ticket #
> >
> > 222-333-4568 2345
> > 2346
> > 9034
> > 0932
> >
> > Count 4 duplicates
> > for TN 222-333-4568
> >
> >
> >
> >
> > I am sure this is probably very simple to do, but I do not have a
 clue.....
> > Thank you...
> >
> > Robin
> >
> >
> >
> >
>
>
Received on Mon Nov 20 2000 - 18:24:58 CET

Original text of this message