Link to home
Start Free TrialLog in
Avatar of Scott Palmer
Scott PalmerFlag for United States of America

asked on

Duplicate records

I have a temporary membership database that has some duplication.  The problem is the on the effective and expiration dates.  They don’t match exactly but they fall inside the other records effective and expiration dates.  Here is an example:

Member_ID      Eff_Date      Exp_Date      Plan      Group
A1234567      1/1/2019      12/31/2019      110      AG569
A1234567      10/1/2019      10/31/2019      110      AG569

I there a way suing in sql to identify the duplicate inside the effective and expiration dates (2nd record) so that I could filter them out.  I don’t want to delete them, just be able to identify them.  Something like adding a field titled “Dups” that would have a “Y” in it if it is a duplicate.

The code for a simple query would be
SELECT Member_ID, Eff_Date, Exp_Date, Plan, Group
FROM Membership;

Thank,
Scott
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scott Palmer

ASKER

I ended up using code from both examples.  


Thanks,
Scott