I have a user table like below. How can I get only non duplicate records for each username? e.g. for username = AAA, I only want to get the row with id = '1' and id ='5', and for username = BBB the row with id = '2'.
id email username
1 test1@test.com AAA
2 test1@test.com BBB
3 test2@test.com CCC
4 test1@test.com AAA
5 test2@test.com AAA