-1
I have the following table called cadastro
:
Cod | name | age
With the data:
COD NOME IDADE
2 | rafael | 15
3 | bruno | 17
4 | rafael | 33
5 | sabrina | 18
6 | bruno | 15
7 | paulo | 15
8 | rafael | 15
Note that some names repeat themselves, I need to run a command on my mysql to delete all repeated names and keep only 1, which contains the largest cod
.
Example:
I have 3 records with the name raphael.
Then I’d just have to keep the 8 | rafael | 15
.
This is possible to be done?
The table changes are part of the question’s scope to prevent this from happening?
– Woss