Click here to Skip to main content
13,056,135 members (52,089 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 11 Mar 2011

Using Pivot In SQL for Reporting

, 11 Mar 2011
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
This member doesn't quite have enough reputation to be able to display their biography and homepage.

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