Jump to content

Duplicate entries


jaymc

Recommended Posts

I have a username field in my database that is set to binary, so basically, Jamie is not the same as jamie

So in their their may be the following usernames

Jamie
jamie
JaMiE

What I want to do is query the database and have it return all the duplicate entries ignoring the rule of character binary

Any ideas
Link to comment
Share on other sites

Hmmm

Basically, I'll explain in a bit more detail what I want to achieve

I have a 100,000 row member database, so basically 100,000 usernames

I want to change the username field to ASCI so usernames are not case sensitive

I cant do that until I remove/rename duplicate usernames

I tried dumping every username from a loop into an array then for each username see if it already exists in the array, if it did then I know its a duplicate entry

But because their is 100,000 rows the script takes a while and dies at 60 seconds for max execution time

Link to comment
Share on other sites

Interesting... I'm going to see what I can come up with.  As a quick hack, just populate a temporary table with the lowercased usernames & counts, and then simply issue a multi-table update, and "skip" the first one of each username with an appropriate limit clause, and concatenate in the lpadded-number.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.