Thanks for the prompt reply. I'll give this a try and let you know.
Main Topics
Browse All TopicsI have a database with medical/dental claims in it. I'm trying to create a SQL query that wil look at all the claims in the past week (for example) and then find any claims in the past 6 months (also for example) that might potentially be a duplicate. By duplicate I mean that the member ID is the same, the procedure code is the same, the provider (doctor) is the same and the claim dollar amount is the same.
I'm having trouble with this and am ending up creating an infinite loop of sorts where I get every claim joined to every other claim.
Any guidance on this would be greatly appreciated...
Basically the table I'm querying has columns (that I'm interested in of the form):
Date_of_service, member_id, claim_number, provider_id, diagnosis_code, claim_amount
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think it's close but I had some other issues come up and I haven't been able to complete this task yet. I hope to be able to get back to it in the next week or so... But rather than let this question hang, I'll go ahead and accept/close it and will post any further information or questions...
Thanks...
Business Accounts
Answer for Membership
by: gigglickPosted on 2008-01-31 at 07:10:32ID: 20787248
select distinct mytable.member_id,mytable.
(select distinct member_id,claim_amount, diagnosis_code from mytable where Date_of_service >= '12/1/2007' and Date_of_service<='12/8/200
on mytable.member_id = new.member_id and mytable.claim_amount = new.claim_amount and mytable.diagnosis_code = new.diagnosis_code
where mytable.Date_of_service =>'1/1/2007' and mytable.Date_of_service <='12/8/2007' order by mytable.member_id, mytable.diagnosis_code, mytable.Date_of_service