Last active
November 4, 2015 04:45
-
-
Save byronferguson/45c6b80287ebe42466d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT (sr.studentResponseValue * cw.categoryWeightValue) AS weightedResponse | |
, cw.occupationalCategoryID AS cID | |
, iqo.interviewQuestionOptionID AS oID | |
FROM dbo.StudentResponseTable AS sr | |
INNER JOIN dbo.InterviewQuestionOptionTable AS iqo | |
ON (sr.interviewQuestionOptionID = iqo.interviewQuestionOptionID) | |
AND (sr.studentID = @studentID) | |
AND (iqo.interviewQuestionOptionActive = 1) | |
INNER JOIN dbo.CategoryWeightTable AS cw | |
ON (sr.interviewQuestionOptionID = cw.interviewQuestionOptionID) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT studentID | |
, occupationalCategoryID | |
, SUM(weightedResponse) AS weightedResponseTotal | |
FROM dbo.weightedInterviewResponsesView | |
GROUP BY studentID, occupationalCategoryID | |
HAVING studentID = @studentID | |
ORDER BY weightedResponseTotal DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment