Good afternoon folks, a quick question for all you SQL gurus out there. I'm cleaning up a table from another person at my company and am running into a small problem.
Assume:
Table: T1
-----------------
Field1 - String, not unique
Field2 - String, not unique
No PK is defined.
I have 58,000 some odd entries in T1, there are other columns but I'm only concerned with these two. There is no unique identifier in this table (it's being migrated into SQL and that hasn't been decided on yet).
Some of the records have initials input into Field2 (such as BA, DO, ZK, etc..). There are multiple entries for the same value in Field1. When I need to do is find all the records where Field1 is the same but Field2 differs, then update Field2 so that all the Field1 records have the same Field2 records. I.e. this:
Existing data:
--------------------
12345 DK
12345 DK
12345 NULL
12345 PD
Data after fix:
-------------------
12345 DK
12345 DK
12345 DK
12345 DK
Can someone point me in the right direction to resolve this? The engine is SQL Server 2000.