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 - 2005-05-06 : 08:12:45
|
| Elena writes "Below is the code I am currently using to dedupe my data. While this works fine, I am not able to protect my client data (filecode 'c') and update the query_id on purchased data (filecode 'p') because SQL has to use the uniqueid field. My data comes in at different times. Purchased lists come in days before the client data, but since they have been imported first, they have the min(uniqueid) instead of the client data.Is there any way other than creating a new uniqueid field based on an index that sorts by filecode to achieve the goal I need? My only reason for not wanting another field is for space reasons. Most files are over 200,000+ recordsUpdate [ClientData_temp] set Query_ID = 'DUPES'from [ClientData_temp]awhere uniqueid not in(select MIN(uniqueid) from [ClientData_temp] B WHERE UPPER(B.LASTNAME) = UPPER(a.LASTNAME)AND UPPER(B.ADDRESS1) = UPPER(a.ADDRESS1)AND B.ZIP = a.ZIPAND B.NTRNLKYCD = A.NTRNLKYCDAND QUERY_ID IS NULL)Thanks in advance,Elena" |
|
|
|
|
|