Number rows based on change in field
Posted on 2012-08-30
I have a query which is pulling records and I need to change the Client_id to an incrementing INT number when the value of a row changes. Example, I have multplie contacts for a customer being returned and when the client_id (which is the same for all the contacts changes) I want to increment the value in a column by 1 like shown.
Dont care if this is done in SQL or EXCEL. Just needed one time
NewID Client_ ContaNumber name
5000 00100000001rlgsAAA 1 CNet
5001 00100000001rlgtAAA 1 VeriSign, Inc.
5002 00100000001tre3AAA 1 21st Century Scientific
5002 00100000001tre3AAA 2 21st Century Scientific
5003 00100000001tre4AAA 1 3 V Co.
5003 00100000001tre4AAA 2 3 V Co.
5004 00100000001tre5AAA 1 3-K Machinery Company Inc.
5004 00100000001tre5AAA 2 3-K Machinery Company Inc.