Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-10-30 : 08:29:32
|
| Keith writes "I have a table where I need to weed-out (or change) redundant email addresses, modifying the records with the older time-stamp.Here's the SELECT statement that gets me those records (but not their ids):"select email,min(date_entered) from (Select a.email, a.user_id, a.date_entered from users a where a.email in(Select a.emailfrom users agroup by a.emailHaving count(a.email) >1)) agroup by emailorder by email"Any suggestion on how the UPDATE statement can just modify the record with the older timestamp? I'm bumping into internal errors - when I used an INNER JOIN,though I have SP2 (http://support.microsoft.com/support/kb/articles/Q245/6/31.ASP)- or 'where exists' errors. Any suggestions?Thanks in advance,Keith" |
|
|
|
|
|