<p>If I have data like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Key</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Dan</td>
</tr>
<tr>
<td>2</td>
<td>Tom</td>
</tr>
<tr>
<td>3</td>
<td>Jon</td>
</tr>
<tr>
<td>4</td>
<td>Tom</td>
</tr>
<tr>
<td>5</td>
<td>Sam</td>
</tr>
<tr>
<td>6</td>
<td>Dan</td>
</tr>
</tbody>
</table>
</div>
<p>What is the SQL query to bring back the records where <code>Name</code> is repeated 2 or more times?</p>
<p>So the result I would want is</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Tom</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dan</td>
</tr>
</tbody>
</table>
</div>
Couldn't be simpler...
```
```
Select Name, Count(Name) As Count 
    From Table
    Group By Name
    Having Count(Name) > 1
    Order By Count(Name) Desc
```
```
This could also be extended to delete duplicates:
```
```
Delete From Table
Where Key In (
    Select Max(Key)
        From Table
        Group By Name
        Having Count(Name) > 1
    )
```
```