Hi, I have a table whose data is in the following format:
ID Column1 Value1
1 State California
1 City Los Angeles
1 Dept HR
1 EmpCount 50
2 State New York
2 City New York
2 Dept Accounting
2 EmpCount 30
2 SubDept Accounting1
...
The ID can have an n number of column1 and value1. I need to write a store proc that would loop through it and bring me back a result set like:
ID State City Dept EmpCount ...
1 California Los Angeles HR 50
2 New York New York Accounting 30 Accounting1...
I would really appreciate if someone can provide some sample code. Thanks in advance.
ID Column1 Value1
1 State California
1 City Los Angeles
1 Dept HR
1 EmpCount 50
2 State New York
2 City New York
2 Dept Accounting
2 EmpCount 30
2 SubDept Accounting1
...
The ID can have an n number of column1 and value1. I need to write a store proc that would loop through it and bring me back a result set like:
ID State City Dept EmpCount ...
1 California Los Angeles HR 50
2 New York New York Accounting 30 Accounting1...
I would really appreciate if someone can provide some sample code. Thanks in advance.