Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL help. Counting duplicate rows (Grrrr kill users!)
Good Catch! Thats what happens when you leap before you look. Sorry, I misunderstood the problem. Hope I didn't confuse the issue.
Thanks,
John Hough
<desparately seeking a whole to hide>
janet <janet_at_telesph.com> wrote:
>Don't think this would work.
>Instead of providing:
>123 3
>456 1
>i think it would provide:
>123 6
>456 2
>
>but do i have an answer? hmmmm..
>perhaps something like:
>column col_2 noprint
>select distinct col_1, col_2, count(*)
>from table_name
>group by col_1, col_2
>/
>
>Ian, are you sure you don't want xxx and yyy and zzz in the output?
>janet
>
>
>John Hough wrote:
>>
>> select col_1, count(*)
>> from table_name
>> having count(*) > 1
>> group by col_1
>> order by count(*) desc
>> /
>>
>> This should get you the list you desire.
>>
>> Hope this helps,
>>
>> John Hough
Received on Tue Nov 26 1996 - 00:00:00 CST