From: Jack on
Hi,
I have a temporary table output which is in the format below.
site cust_num slsman sales_ytd sales_lastyr
11121 C000200 904 0 0
11199 C000200 904 1023.1 0
11099 C000200 904 0 0
11111 C000200 904 343.5 25
11112 C000200 904 0 0
11103 C000201 927 2000.12 3000
11101 C000201 927 325.12 100.33
11199 C000201 927 0 0
11121 C000201 927 245.5 0


However I need to come up with a sql manipulation which will transform the
above in the following format:

cust_num slsman
11121_ytd 11121_lastyr 11199_ytd 11199_lastyr 11099_ytd 11099_lastyr 11111_ytd 11111_lastyr 11112_ytd 11112_lastyr 11103_ytd 11103_lastyr 11101_ytd 11101_lastyr 11199_ytd 11199_lastyr
c000200 904 0 0 1023.1 0 0 0 343.5 25 0 0
c000201 904 245 0 2000.12 3000 325.12 100.33 0 0




I have not idea how to do this. I appreciate any help for this resolution.
Thanks.