Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
22
Reply
Dynamic Columns in SQL Query
Riddhi Valecha
Dec 11 2013 12:33 AM
1.7k
Reply
Hi all.. I need help in forming a SQL Query.
My requirement is - I have the table as follows-
ID
Date
Status
Count
Company
Location
1
1-1-2010
Clear
1
D
E
2
2-3-2010
Clear
2
C
F
3
1-1-2010
Rejected
3
B
G
4
2-3-2010
Rejected
4
A
H
Now, I want the output as follows in the sql query -
ID
Date
Jan-2010Clear
Jan-2010Rejected
Feb-20101Clear
Feb-2010 Rejected
Total
1
1
3
2
4
10
2
3
Total
1
3
2
4
10
I am not able to create dynamic columns in query.
Please Help..
Thanks a lot in advance....
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
22
)
Next Recommended Forum
Dynamic Columns in SQL Query
user control in c# windows applications