Note that there are some explanatory texts on larger screens.

plurals
  1. POLocate Duplicates
    text
    copied!<blockquote> <p>Disclaimer: I am still learning SQL so I apologize if my question comes off as amateur-ish or is otherwise a very simple answer. I have no formal training. I am teaching myself. Thanks.</p> </blockquote> <p>I am looking for a proper query to locate duplicates in a table. Here's what I currently have:</p> <blockquote> <p>SELECT [Name]</p> <p>FROM [02Kids] As Tmp<br> GROUP BY [Name]<br> HAVING Count(*)>1</p> <p>order by Name asc</p> </blockquote> <p>This works...sort of. It does return results where a specific 'Name' occurs more than once. The number of times it occurs isn't relevant though I do have a query for that too.</p> <p>The problem I've run into is that this is actually part of a larger update query and while that too works, I've come to find out that my duplicates aren't all "truely" duplicates.</p> <p>To be more specific, here's an example of some data pulled using a simple select query where a name is specified:</p> <p><a href="http://i946.photobucket.com/albums/ad309/AGx-07_162/Capture_zps22107e1b.png" rel="nofollow noreferrer">http://i946.photobucket.com/albums/ad309/AGx-07_162/Capture_zps22107e1b.png</a></p> <p>Note the CustNo column for each set of results. While the "Name" matches in each set of results, the CustNo is different for the first set. These are not truly duplicates as they do not belong to the same Customer.</p> <p>Is there any way I can perform some sort of comparison to only return Names where the CustNo is the same?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload