Q:

Remove Duplicate rows from DataGrid

I am using ASP.NET DataGrid Class. asp:DataGrid I want to remove certain rows based on the following condition.
For Example:
Complaint-Number        Attempts   Time
6000000939              1          11:02:00
6000000939              2          11:04:00
6000000939              3          11:09:00

I want to keep only those Complaints which has the highest Attempts like.
Complaint-Number        Attempts   Time
6000000939              3          11:09:00

I tried this Example but still no luck Eliminate Duplicate
NOTE: Please note that I am using asp:DataGrid class.
Please find the Screenshot of my report for your reference.

A:

In your Select statement try something like this.:
SELECT *
FROM yourTable 
WHERE (Attempts IN
               (SELECT MAX(Attempts) AS Expr1
                FROM yourTable AS yourTable_1))

It is called Subquery and you can read more about it here: Subquery Fundamentals.

