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
Sukhada Vader
NA
64
28.5k
Use Of PIVOT in SQL Server without aggregate function
Mar 15 2018 2:53 AM
I want to change rows into column as it is.. means without any aggregate function on coming answer. like i have 2 columns as ExamType and Obtained marks 1st will contains the values like
ExamTypeCode ObtainedMarks
1 18
2 20
3 45
1 15
2 22
3 47
and i want the data like following without any aggregate function
1 2 3
----------------
18 20 45
15 22 47
I have tried the following query , its giving me ans but not like which i want
SELECT
*
FROM
(
SELECT
StudentRegCode,ExamTypeCode,ObtainedMark
FROM
StudentSubjectMark
)
AS
SourceTable
PIVOT
(
MIN
([ObtainedMark])
FOR
[ExamTypeCode]
IN
([1],[3],[4]))
AS
PivotTable;
Reply
Answers (
2
)
How to update entity framwork
C# Threading Error