How to filter out similar rows (equal on certain columns) based on other column data.
How would I select all rows distinct on **Forename** and **Surname** and where there's a duplicate select the one with the higher **SomeDate**, then **Id** if still duplicates e.g.

For:
<pre>
| Id | Forename | Surname | SomeDate   |
----------------------------------------
| 1  | Bill     | Power   | 2011-01-01 |
| 2  | James    | Joyce   | 2011-02-01 |
| 3  | Peter    | Lennon  | 2011-03-01 |
| 4  | John     | Sellers | 2011-04-01 |
| 5  | James    | Joyce   | 2011-05-01 |
| 6  | Peter    | Lennon  | 2011-03-01 |
</pre>

Results in:
<pre>
| Id | Forename | Surname | SomeDate   |
----------------------------------------
| 1  | Bill     | Power   | 2011-01-01 |
| 4  | John     | Sellers | 2011-04-01 |
| 5  | James    | Joyce   | 2011-05-01 |
| 6  | Peter    | Lennon  | 2011-03-01 |
</pre>

How could I achieve this in

 1. T-SQL
 2. From a DataTable using C#
How to filter out similar rows (equal on certain columns) based on other column data.
===

How would I select all rows distinct on **Forename** and **Surname** and where there's a duplicate select the one with the higher **SomeDate**, then **Id** if still duplicates e.g.

For:
<pre>
| Id | Forename | Surname | SomeDate   |
----------------------------------------
| 1  | Bill     | Power   | 2011-01-01 |
| 2  | James    | Joyce   | 2011-02-01 |
| 3  | Peter    | Lennon  | 2011-03-01 |
| 4  | John     | Sellers | 2011-04-01 |
| 5  | James    | Joyce   | 2011-05-01 |
| 6  | Peter    | Lennon  | 2011-03-01 |
</pre>

Results in:
<pre>
| Id | Forename | Surname | SomeDate   |
----------------------------------------
| 1  | Bill     | Power   | 2011-01-01 |
| 4  | John     | Sellers | 2011-04-01 |
| 5  | James    | Joyce   | 2011-05-01 |
| 6  | Peter    | Lennon  | 2011-03-01 |
</pre>

How could I achieve this in

 1. T-SQL
 2. From a DataTable using C#