Click here to Skip to main content
15,925,602 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCompare 160 million records Pin
RajaAhmed2-Feb-09 5:14
RajaAhmed2-Feb-09 5:14 
AnswerRe: Compare 160 million records Pin
Manas Bhardwaj2-Feb-09 5:22
professionalManas Bhardwaj2-Feb-09 5:22 
GeneralRe: Compare 160 million records [modified] Pin
Colin Angus Mackay2-Feb-09 5:39
Colin Angus Mackay2-Feb-09 5:39 
GeneralRe: Compare 160 million records Pin
RajaAhmed2-Feb-09 19:00
RajaAhmed2-Feb-09 19:00 
GeneralRe: Compare 160 million records Pin
Colin Angus Mackay2-Feb-09 21:30
Colin Angus Mackay2-Feb-09 21:30 
AnswerRe: Compare 160 million records Pin
Colin Angus Mackay2-Feb-09 5:44
Colin Angus Mackay2-Feb-09 5:44 
GeneralRe: Compare 160 million records Pin
RajaAhmed2-Feb-09 19:03
RajaAhmed2-Feb-09 19:03 
GeneralRe: Compare 160 million records Pin
Colin Angus Mackay2-Feb-09 21:40
Colin Angus Mackay2-Feb-09 21:40 
You can find duplicates using something like this:

SELECT MAX(PrimaryKey), COUNT(*)
FROM MyEmailTable
GROUP BY EmailAddress
HAVING COUNT(*) >= 2


The above gives you a list of duplicate rows. You can then use that to delete the duplicates.

e.g.

DELETE FROM MyEmailTable
WHERE PrimaryKey IN
(
    SELECT MAX(PrimaryKey)
    FROM MyEmailTable
    GROUP BY EmailAddress
    HAVING COUNT(*) >= 2
)


Also note that it will only remove one duplicate per email address, if there are multiple duplicates then you have to run it multiple times.

NOTE: The above SQL hasn't been tried and may have some syntax errors. Always test on a development database. Do not run this on a live database until you are sure it works they way you want.

*Developer Day Scotland - Free community conference
*Colin Angus Mackay's Blog
*Latest Scottish Developers Newsletter


Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Remember that the force of gravity can go up as well as down.

Questioncustom Action Pin
siva4552-Feb-09 3:15
siva4552-Feb-09 3:15 
QuestionChanging Gridview Color at runtime Pin
BalasubramanianK2-Feb-09 2:11
BalasubramanianK2-Feb-09 2:11 
AnswerRe: Changing Gridview Color at runtime Pin
Vimalsoft(Pty) Ltd2-Feb-09 3:03
professionalVimalsoft(Pty) Ltd2-Feb-09 3:03 
QuestionNeed help for new website. Pin
Rahul.RK2-Feb-09 1:46
Rahul.RK2-Feb-09 1:46 
AnswerRe: Need help for new website. Pin
SeMartens2-Feb-09 2:07
SeMartens2-Feb-09 2:07 
QuestionNot enough storage is available to complete this operation in asp Pin
richa0212-Feb-09 1:40
richa0212-Feb-09 1:40 
AnswerRe: Not enough storage is available to complete this operation in asp Pin
SeMartens2-Feb-09 1:44
SeMartens2-Feb-09 1:44 
GeneralRe: Not enough storage is available to complete this operation in asp Pin
richa0212-Feb-09 1:57
richa0212-Feb-09 1:57 
GeneralRe: Not enough storage is available to complete this operation in asp Pin
SeMartens2-Feb-09 2:03
SeMartens2-Feb-09 2:03 
GeneralRe: Not enough storage is available to complete this operation in asp Pin
richa0212-Feb-09 20:49
richa0212-Feb-09 20:49 
GeneralRe: Not enough storage is available to complete this operation in asp Pin
SeMartens2-Feb-09 21:04
SeMartens2-Feb-09 21:04 
Questioncontext menu with gidview without ajax toolkit Pin
md_refay2-Feb-09 0:39
md_refay2-Feb-09 0:39 
AnswerRe: context menu with gidview without ajax toolkit Pin
Abhijit Jana2-Feb-09 0:53
professionalAbhijit Jana2-Feb-09 0:53 
QuestionContext Menu With TreeView Without Ajax Pin
md_refay2-Feb-09 0:37
md_refay2-Feb-09 0:37 
AnswerRe: Context Menu With TreeView Without Ajax Pin
Spunky Coder2-Feb-09 0:55
Spunky Coder2-Feb-09 0:55 
Questionupdate machine.config Pin
siva4552-Feb-09 0:29
siva4552-Feb-09 0:29 
AnswerRe: update machine.config Pin
Spunky Coder2-Feb-09 0:49
Spunky Coder2-Feb-09 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.