Take the same field and the maximum record of another field in SQL
Sql takes the record with the largest value of the B field of the repeated record in the A field
Select max (id) id,name from table group by name
If there are other fields in the table to find out, then
Select * from table where id in (select max (id) from table group by name)