I need a T-SQL routine that takes Table1 in this format:
(
DUNS [char] (9)-with duplicate values,
INDICATOR [char] (4)-
)
111111111 abc1
111111111 abc2
111111111 abc3
.....................
111111111 abc6
222222222 def1
222222222 def2
222222222 def3
333333333 ghi1
and creates a new table Table2 in this format:
(
DUNS [char] (11)- only UNIQUE VALUES,
IND1 [char] (4)
IND2 [char] (4)
IND3 [char] (4)
IND4 [char] (4)
IND5 [char] (4)
IND6 [char] (4)
)
111111111 abc1 abc2 abc3 abc4 abc5 abc6
222222222 def1 def2 def3 NULL NULL NULL
333333333 ghi1 NULL NULL NULL NULL NULL
ANY HELP IS VERY MUCH APPRECIATED
Thanks
(
DUNS [char] (9)-with duplicate values,
INDICATOR [char] (4)-
)
111111111 abc1
111111111 abc2
111111111 abc3
.....................
111111111 abc6
222222222 def1
222222222 def2
222222222 def3
333333333 ghi1
and creates a new table Table2 in this format:
(
DUNS [char] (11)- only UNIQUE VALUES,
IND1 [char] (4)
IND2 [char] (4)
IND3 [char] (4)
IND4 [char] (4)
IND5 [char] (4)
IND6 [char] (4)
)
111111111 abc1 abc2 abc3 abc4 abc5 abc6
222222222 def1 def2 def3 NULL NULL NULL
333333333 ghi1 NULL NULL NULL NULL NULL
ANY HELP IS VERY MUCH APPRECIATED
Thanks