SELECT [Course Section], [Instructor Name], [Respondent Code],
max([1]) as [1],
max([2]) as [2],
max([3]) as [3],
max([4]) as [4],
max([5]) as [5]
FROM [sirssoctonlineforms].[dbo].[Denormalized_V]
where term = 'ss14' and subject = 'iss' and course like '%330%'
group by [Course Section], [Instructor Name], [Respondent Code]
order by subject, course, [course section], [respondent code]
Combine multiple result rows into one in SQL
-
23-07-2023 - |
Question
I have this SQL:
SELECT [Course Section], [Instructor Name], [Respondent Code], [1], [2], [3], [4], [5]
FROM [sirssoctonlineforms].[dbo].[Denormalized_V]
where term = 'ss14' and subject = 'iss' and course like '%330%'
order by subject, course, [course section], [respondent code]
And the results are:
Respondent Code 1 2 3 4 5
1281172 Average Above Average Above Average Above Average NULL
1281172 NULL NULL NULL NULL Average
What I want to see is this:
Respondent Code 1 2 3 4 5
1281172 Average Above Average Above Average Above Average Average
Is there any way I can do this?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow