I did search, trust me.. in the forums and the web
I have a database, the creator didn't care about any type of anything... so I have 900K "users" but this also includes people who forgot their password and created a new account...
What I am trying to do is reduce this and get rid of the duplicates... but i need to do it rationally
first I want to find all records where the email address is duplicated and display them along with the unique ID
then I need to alter any refrence to the duplicated id's, making them all match a single ID
then I need to delete the duplicate records
example
USERS
U_ID, NAME, EMAIL
110, tom, example@example.com
9865, tommy, example@example.com
47472, tbone, example@example.com
ORDERS
O_ID, U_ID, ITEM
918, 110, widget
1858, 110, widget2
1938, 9865, widget3
4438, 9865, widget4
4555, 9865, widget5
6684, 9865, widget6
163468, 47472, widget7
175684, 47472, widget8
COMMENTS
C_ID, O_ID, U_ID, COMMENT
158, 918, 110, "GREAT!"
1883, 4555, 9865, "Had a problem, but resolved"
16548, 175684, 47472, "Wicked"
Notice, the user email is what I am trying to match here, I could care less wat he wants to call himself... I need to find out that he is USER 110, 4862 & 47472 then alter the tables for ORDERS and COMMENTS, changing ALL U_ID values to 47472 (last record) then delete from my database users 110 and 4862
I hope this makes sence, if you need any more details please feel free to ask... I honstly have NO IDEA where to start with this one...