March 7, 2011 at 10:17 am
Hello All,
I have created a query to find the contact list from a database. However what i found out was that there were a lot of duplicates in the results.
Example:
First Name Last Name Phone Company
Anthony Silva 915-111-2131 Accenture
Anthony Silva 915-111-2131 Accenture
Now the result set shows me over 10,000 rows and i was wondering how can i create a query to find out just the ones that are duplicates.
The data type for all the fields is varchar(50).
I appreciate all the help!
Thanks!
March 7, 2011 at 11:10 am
Without DDL and sample data like you'll find in the first link in my sig, best I can offer is general advice.
What you'll want to do is generate a query based on your possible duplication columns, use them in a group by, and use a having COUNT(*) > 1 clause on it.
This will display all dupes.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
March 7, 2011 at 12:59 pm
chaudharyabhijit
Now the result set shows me over 10,000 rows and i was wondering how can i create a query to find out just the ones that are duplicates.
And once these are found what do you desire (need) to do, eliminate the duplicates so that only one entry remains or?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply