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

Home -> Community -> Usenet -> c.d.o.misc -> Re: duplicates query

Re: duplicates query

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: Thu, 05 Jul 2007 04:44:31 -0700
Message-ID: <1183635871.036905.31470@r34g2000hsd.googlegroups.com>


On Jul 5, 6:24 am, colmkav <colmj..._at_yahoo.co.uk> wrote:
> How can I return the list of duplicates that occur in a table?
>
> For example I have 9996 distinct books in a table of 10000 records and
> I want to know which 4 are repeated.

Try GROUP BY with a HAVING clause:

GROUP BY
  BOOKS.BOOK_NAME
HAVING
  COUNT(*)>1 Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Thu Jul 05 2007 - 06:44:31 CDT

Original text of this message

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