Solved

Displaying column data

Posted on 2009-04-11
2
193 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
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now