then you need to pass the courses as a comma seperated list in a parameter and use it likeDECLARE @Courselist varchar(8000)SET @CourseList='Math,Physics,Biology,English'select S.Name from Students Sjoin StodentCourses SC ON S.ID = SC.StudentIDjoin Courses ON C.CourseID = C.IDwhere ',' + @CourseList + ',' LIKE '%,' + C.Name + ',%'GROUP BY S.NameHAVING COUNT(DISTINCT C.Name)=LEN(@CourseList)-LEN(REPLACE(@CourseList,',',''))+1AND SUM(CASE WHEN C.Name = 'Math' THEN C.Grade ELSE 0 END)>80 order by S.Name
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/