Ok so I have this script. I need it to behave like this, if the S.Term='3' then grab the data from S.WDIS otherwise leave it alone and pull whatever is in the term column. Basically that data in s.term can't be changed but I need to be able to have multiple values if it is a 3 (which denotes it as a year long class) so I have another column with the correct term code in it but the other values are all correct which are 1 and 2.
Code:
SELECT DISTINCT
S.Course_ID, T.HR_Code, S.Section_Number, S.Room_Number, S.Period_Start, S.Term
FROM Master_Schedule S
LEFT JOIN Teacher T
ON S.School_Year = T.School_Year AND S.Location = T.Teacher_School_Num AND
S.Teacher_SSN = T.Teacher_Local_ID
WHERE S.School_Year=1112 AND
S.Location=0021 AND
Teacher_Room<>'SFCC' ---Removes College Teachers
ORDER BY S.Course_ID, S.Section_Number