Solved

Displaying column data

Posted on 2009-04-11
2
232 Views
Last Modified: 2012-05-06
I have a stored proc that brings back data like this:
Id, Name, Code, Quantity
1    x          c1        2
2    y         c2         5
3    z          c1        10

I want to have it like this: basically, i want to have "Code" as the column header with "quantity" under it. I dont want to have a olumn for code and a column for corresponding quantity. Doable??

id, Name, c1,  c2,
1   x         2      0
2   y         0      5
3  z          10    0
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
QuintainT earned 500 total points
ID: 24124665
This can probably be done using a PIVOT query. See http://www.mssqltips.com/tip.asp?tip=1019 
This requires you to have a fixed, known number of codes to work though. Is this possible?
0
 
LVL 7

Author Comment

by:Camillia
ID: 24125320
let me look, will post back.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question