Need help with pivot or union please.
My table has the fillowing columns
One Auth_Prof_Cde could have multiple Sys, Prin, Agent, Eqp_Typ, Head_End_Cde, Eqp_Protocol
What I would like the data I pull to look like is below but I'm not sure how to accomplish. Any help would be greatly appreciated
For each distinct combo of Sys, Prin, Agent, Eqp_Typ, Head_End, Eqp_Protocol instead of it listing each Autho_Cde_Type and Auth_Cde on a seperate row I would like it to display in a different column.
What data looks like
AUTH_PROF_CDE SYS PRIN AGNT AUTH_CDE_TYP EQP_TYP HEAD_END_CDE EQP_PROTOCOL AUTH_CDE
VSC52 8,495 6,000 0 S KC JD 42031
VSC52 8,495 6,000 0 S H1 SD 31
VSC52 8,495 6,000 0 S KC JD 39500
VSC52 8,495 6,000 0 S MQ SD 31
VSC52 8,495 6,000 0 S MZ SD 31
VSC52 8,495 6,000 0 S SC SD 31
VSC52 8,495 6,000 0 S H2 SD 7
VSC52 8,495 6,000 0 S MQ SD 7
What I would like data to look like
AUTH_PROF_CDE SYS PRIN AGNT EQP_TYP HEAD_END_CDE EQP_PROTOCOL AUTH_CDE_TYP AIU1 AIU2 AIU3 AIU4 AIU5
VSC52 8,495 6000 0 MS SD S 7 25 31
VSC52 8,495 6000 0 SC SD S 7 25 31
VSC52 8,495 6000 0 MQ SD S 7 25 31
VSC52 8,495 6000 0 MZ SD S 7 25 31
VSC52 8,495 6000 0 H2 SD S 7 25 31
VSC52 8,495 6000 0 CM SD S 7 25 31
VSC52 8,495 6000 0 MG SD S 7 25 31
VSC52 8,495 6000 0 H1 SD S 7 25 31
VSC52 8,495 6000 0 H6 SD S 7 25 31
VSC52 8,495 6000 0 MO JD S 33233 39500 42031 116332 116403
VSC52 8,495 6000 0 KC JD S 33233 39500 42031 116332 116403
VSC52 8,495 6000 0 MW JD S 33233 39500 42031 116332 116403
VSC52 8,495 7500 0 MO JD S 39500
VSC52 8,495 7500 0 KC JD S 39500
VSC52 8,495 7500 0 MW JD S 39500
VSC52 8,495 7400 SD S 106 180 281 282
Here is a sample