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: HOW TO FIND THE DUPLICATE VALUES IN A VERTICAL TABLE

Re: HOW TO FIND THE DUPLICATE VALUES IN A VERTICAL TABLE

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Thu, 21 Oct 2004 18:49:32 -0700
Message-ID: <1098409718.887812@yasure>


Katekaneni wrote:

> Hi There,
> I have a quick question, we have a vertical table where we store the
> properties of an id in "name" "value" pairs and I am trying to find
> out the contact ids, which has duplicate set of information in an
> efficient way and set the flag to ‘Y'. The set of property names are
> not fixed they may vary for every load and each load size varies from
> 10k to 5M records.
>
> Example:
> Select id,prop_name,prop_value,duplicate_flag from myid_props
>
> ID PROP_NAME PROP_VALUE DUPLICATE_FLAG
> 171 lastname Reckmo N
> 171 firstname Kevin N
> 171 number 139388912 N
> 172 lastname Reckmo N
> 172 firstname Kevin N
> 172 number 139388913 N
> 173 lastname Reckmo N
> 173 firstname Kevin N
> 173 number 139388913 N
>
> I want to set the duplicate_flag to ‘Y' for contact_id 173 , it's
> because all properties are same as contact_id 172 properties.
>
> Any input is highly appreciated.
>
> Thanks,
> Katekaneni

By what logic do you set the flag in 173 and not 172 or not in both?

The beginning of the solution is to use GROUP BY with a HAVING clause.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Oct 21 2004 - 20:49:32 CDT

Original text of this message

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