We help IT Professionals succeed at work.
Get Started

SQL - PIVOT

Rogero
Rogero asked
on
376 Views
Last Modified: 2012-05-07
Hi there, Can someone help with this please? I think the PIVOT function will help?

File attached

TIA, Roger
Source
 
postcode		cust
AB10		AMI004
AB10		CLI001
AB10		HCL001
AB10		MIL003
AB10		OSB001
AB11		AMI004
AB11		CLI001
AB11		HCL001
AB11		MIL003
AB11		OSB001
AB12		AMI004
AB12		CLI001
AB12		ABC001
AB12		THK010
AB12		NHF001
AB12		HGF002
 
 
Output required
 
 
postcode		cust
 
AB10		AMI004, CLI001, HCL001, MIL003, OSB001
AB11		AMI004, CLI001, HCL001, MIL003, OSB001
AB12		AMI004, CLI001, ABC001, THK010, NHF001, HGF002

Open in new window

Pivot-Test-Data.txt
Comment
Watch Question
Chief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE