Click here to Skip to main content
11,924,800 members (54,066 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked

Using Pivot In SQL for Reporting

, 11 Mar 2011 CPOL
select * from(SELECT l.Prepared_Date as Prepared_Date , m.Material_Code as Material_Code ,n.Name as Name,n.Description as Description , m.Quantity as Quantity,n.Unit_Of_Measure as Unit_Of_Measure , m.Status as Status...


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

28 Feb 2011
code in play
2 alternatives  
Nice and fast way for reporting
15 Mar 2011
Kannan K R
select ExDate, SUM(case when Dept='A' then expense else 0 end)[Store A Expense],SUM(case when Dept='B' then expense else 0 end)[Store B Expense],SUM(case when Dept='C' then expense else 0 end)[Store C Expense]from expenseTable where Dept in ('A','B','C') group by ExDate


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Feleke Feyissa
United States United States
No Biography provided

| | Privacy | Terms of Use | Mobile
Web01 | 2.8.151125.3 | Last Updated 11 Mar 2011
Article Copyright 2011 by Feleke Feyissa
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid