Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL help. Counting duplicate rows (Grrrr kill users!)

Re: SQL help. Counting duplicate rows (Grrrr kill users!)

From: janet <janet_at_telesph.com>
Date: 1996/11/26
Message-ID: <329B4390.392C@telesph.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US