Re: SQL Duplicates ?

From: Eric Givler <egivler_at_flash.net>
Date: Tue, 14 Nov 2000 18:01:07 GMT
Message-ID: <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 Tue Nov 14 2000 - 19:01:07 CET

Original text of this message