I have the following table named 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, I need to run a command on my mysql to erase all repeated names and keep only 1, which contains the cod
.
Example:
I have 3 records with the name rafael .
In this case you would have to keep only the 8 | rafael | 15
.
Is it possible to do this?