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: HELP! Oracle script for identify identical records

Re: HELP! Oracle script for identify identical records

From: gazzag <gareth_at_jamms.org>
Date: Thu, 19 Jul 2007 04:23:50 -0700
Message-ID: <1184844230.063474.52990@g4g2000hsf.googlegroups.com>


On 18 Jul, 16:41, "ko" <ko..._at_singnet.com.sg> wrote:
> I have a table which consists of n columns. I need to list those identical
> records.
> The coditions for identical records are column A and column B of those
> records must contain the same value and column C must contain 'Y'.
> Can someone enlighten me how to write an Oracle SQL script to accomplish
> this?
>
> Many thanks for your help.

What have you tried so far? Anyway, you want something like the following:

SELECT <column_A>, <column_B>, <column_C>, count(*) FROM <table_name>
WHERE <column_A> = <column_B> AND <column_C>='Y' GROUP BY <column_A>, <column_B>, <column_C> HAVING COUNT(*) > 1; HTH -g Received on Thu Jul 19 2007 - 06:23:50 CDT

Original text of this message

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