How to find duplicate records?

A 5 star hangout for overworked and underpaid system admins.
Post Reply
Posts: 7
Joined: 2016/05/24 12:08:33

How to find duplicate records?

Post by Kinjal » 2016/06/01 12:46:45

Database Table that contains two different records for every user id, but value in the column "Dept" has dissimilar values for every record. I want to yield all records which comprises duplicate UserName

userid UserName Dept
111 JDe Accounts
111 JDe Travel
222 ML Bussiness
222 ML Vacation
333 BPD Travel
444 MGb Business

[Moderator: moved to CentOS Social as this is not a CentOS question]

Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: How to find duplicate records?

Post by gerald_clark » 2016/06/01 13:17:33

This is not CentOS problem, and definitely not a network issue.
You should ask in a forum for whatever database you are using.

User avatar
Forum Moderator
Posts: 29493
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to find duplicate records?

Post by TrevorH » 2016/06/01 15:20:27

What database are you using?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Posts: 3022
Joined: 2014/09/20 11:22:14

Re: How to find duplicate records?

Post by aks » 2016/06/01 15:53:06


Posts: 7
Joined: 2016/05/25 06:06:21

Re: How to find duplicate records?

Post by tamarin_t » 2016/06/07 14:03:03

Traditional unix text processing utils `cut` to select individual fields and `uniq` to filter duplicate records would do this.

I would use a relational database for anything other than a one off task requiring minimal processing - `sqlite` is installed on most systems.

Post Reply

Return to “CentOS Social”