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: Find Duplicate Values with Varying Start Dates

Re: Find Duplicate Values with Varying Start Dates

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 27 Feb 2006 09:13:03 -0800
Message-ID: <1141060378.827613@jetspin.drizzle.com>


is_db wrote:
> I am trying to find all duplicate values in a 7-day date range so that
> if an item/customer combination exists more than once either 3-days
> before or after the date being evaluated it will be returned as having
> a duplicate. All days in the table need to be evaluated in a loop
> fashion so that each item is compared to all duplicate item/customer
> combinations in the 3-day period before or after the sale date.

And what help would you like?

First write a SQL statement that returns the range you want. Then turn it into an in-line view by wrapping parentheses around it and performing a SELECT COUNT(*) with HAVING COUNT(*) > 1;

After that do whatever it is you intend to do with the offending set of records.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Feb 27 2006 - 11:13:03 CST

Original text of this message

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