Unix Technical Forum

Sql Query with one column as the name to another column

This is a discussion on Sql Query with one column as the name to another column within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi There Does anyone know how to create a query or do something in a stored procedure to output ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 08:09 AM
marlene
 
Posts: n/a
Default Sql Query with one column as the name to another column

Hi There

Does anyone know how to create a query or do something in a stored
procedure to output one column as the other columns name? The output I
want is something like this:

CurrentMonth(Jun 05) May 05 April 05
ItemCode Units Price Units Price Units Price

A 10 10.00 5 8.00 12 12.00

The month displayed as the column names will be in fields
CurrentMonthDesc, SalesHistoryDesc1, SalesHistoryDesc2 etc. Now I want
these to be the headings to Current, SalesHistory1, SalesHistory2 etc.

Please help!

Kind Regards
Marlene

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com