I have a single table with about 200,000 records. Each record refers to a single customer, but a customer may have one or more records. I need to identify which records belong to which customers and create a new field customer_id. So 1 or many records could end up with the same customer_id value. I can say that two or more records belong to the same customer if the values in fieldA match AND the values in fieldB match i.e. same customer if (rs1.fieldA = rs2.fieldA = rs[n].fieldA) AND (rs1.fieldB = rs2.fieldB = rs[n].fieldB)
For example, fields dob and ID are the fields I need to match to determine which records belong to which customers so
in the above mentioned query the "@CustomerID" is a Parameter that you can change similarly you can specify Parameters for the "dob" and "ID". if you want your query to be even more dynamic. but please do check out the format of the date etc.
The simplest solution would be to create a table with three columns: custid, date, and id. Select all of the unique combinations of date and id into this working table. Once you've isolated them, create new id values and assign them to this working table.
If you know which database engine you are using and how you want the new custId values formed, I could also provide an example.