Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rows into dynamic columns

Status
Not open for further replies.

lavadan

Programmer
Dec 17, 2007
49
US
I have a table with name and Amount

Name Amount
rita 100.00
rick 100.00
sam 150.00
harry 200.00
heather 290.00
James 200.00

I was wondering if I can do a dynamic pivot on Amount Column so that my result will be

100 150 200 290
Rita Sam Harry Heather
Ram James
 
select distinct (amount) from table union select name from table;

then use powershell or unix shell to convert the carriage return/line feed characters to space.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top