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]
How to find duplicate records?
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: How to find duplicate records?
This is not CentOS problem, and definitely not a network issue.
You should ask in a forum for whatever database you are using.
You should ask in a forum for whatever database you are using.
Re: How to find duplicate records?
What database are you using?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: How to find duplicate records?
SELECT UserName, COUNT(*) FROM <TABLE> UserName HAVING COUNT(*) > 1;
Re: How to find duplicate records?
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.
I would use a relational database for anything other than a one off task requiring minimal processing - `sqlite` is installed on most systems.