Sunday, August 31, 2014

Interesting SQL Programming Problem

The less obstructive way to achieve this is to create a view that contains the latest student status, for instance...



CREATE VIEW vStudent
AS
SELECT Name, Semester, Status FROM Student
WHERE Semester = (SELECT MAX(B.Semester) FROM Student B WHERE Student.Name = B.Name)






and join with that table. Am assuming a lot about your structure but in order to get better help you need to post the related schema.

No comments:

Post a Comment