TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sourabh choubey
NA
174
46k
dynamiv pivot in sql server
Jul 12 2016 2:38 AM
select * from
(select dbo.CreditDebitExpenses.ID AS SLNO, TransactionDate, Particular,Expenses_Name,Debit_Expenses,Credit_Expenses,Expenses,Balance from dbo.CreditDebitExpenses inner join
dbo.CreditExpenses on dbo.CreditDebitExpenses.ID=dbo.CreditExpenses.Credit_ID
inner join dbo.Expenses on dbo.CreditExpenses.Expenses_ID=dbo.Expenses.ID )src
pivot
(
sum(Expenses)
for Expenses_Name In ([Electrical_Expenses],[Lift_Expenses],[BuildingMaintainence_Expenses],[Miscelleneous_Expenses])
)as pvt
i want [Electrical_Expenses],[Lift_Expenses],[BuildingMaintainence_Expenses],[Miscelleneous_Expenses] that is the records in expenses table having column name expenses_name is created dynamically no need to write as above..
Reply
Answers (
23
)
Receipt Printing without Preview
How to learn designing best Website and thinking about desig