T-SQL solution to my problem :)
I have a problem needs to be solved. I have a table with 3 fields like this:

ProfessorID    StudentID	Mark

P1		S1	         9

P1		S2	         8

P1		S3	        10

P2		S1	         7

P2		S2	         2

P2		S3	         4

P3		S4	         5

P4		S1	         6


A professor can teach many student, and vice versa, a student can learn from many professor. When a student learns from a professor, he gets his mark.

My problem is show list of professors who teach at least 2 students, and 2 students who gets best mark from those professors. In example, the query result of this table is:

ProfessorID    StudentID	Mark

P1		S1	         9

P1		S3	        10

P2		S1	         7

P2		S3	         4


I've tried some solutions but they don't work **right**. So, I need your helps.

Thank you very much!
                            

T-SQL solution to my problem :)
===

I have a problem needs to be solved. I have a table with 3 fields like this:

ProfessorID    StudentID	Mark

P1		S1	         9

P1		S2	         8

P1		S3	        10

P2		S1	         7

P2		S2	         2

P2		S3	         4

P3		S4	         5

P4		S1	         6


A professor can teach many student, and vice versa, a student can learn from many professor. When a student learns from a professor, he gets his mark.

My problem is show list of professors who teach at least 2 students, and 2 students who gets best mark from those professors. In example, the query result of this table is:

ProfessorID    StudentID	Mark

P1		S1	         9

P1		S3	        10

P2		S1	         7

P2		S3	         4


I've tried some solutions but they don't work **right**. So, I need your helps.

Thank you very much!
                            
