Not sure how to phrase the question really, but here's what I have and here's what I need.
I've got a table that looks like this:
Name K% Year
Albert Pujols 7.90% 2006
Albert Pujols 8.50% 2007
Albert Pujols 8.40% 2008
Albert Pujols 9.10% 2009
Albert Pujols 10.90% 2010
Albert Pujols 8.90% 2011
Albert Pujols 11.30% 2012
I'd like to create a query that will produce output that looks like:
Albert Pujols 7.90% 8.50% 8.40% 9.10% 10.90% 8.90% 11.30%
While this particular player has 7 rows, I can't be guaranteed that such will exist.
Is this even possible?
I'd appreciate any help. I wouldn't have any trouble if I knew that there were only 2 rows (inner join on name)... but the variable number of rows is throwing me for a loop.
Edit**
Peter Wooster's answer of pivoting was the solution I needed.