hi
I have a database with some columns
The first column contains the student's name
The second column contains the student's assessment or rate
The third column contains the test number for students
Student evaluation is as follows:
My number is 0-10
Or my string : # - not
A query is required to fill out the datatable and bite into the DataGrid View, where the sql database is as follows:
Note: The same students take exams in the form of a first ' t1', second' t2', third, etc.
Show the required students in DataGrid view, where the following is:
Every student has his data.
Each student is adjusted according to the test number. If a student takes an assessment, the student's grade appears. If nothing is taken, the student's name below the test number skips the student.
If a student takes a 'not' text assessment, on one test number and another 'not' test number, then the student skips each test for the same assessment, as the number of tests is not specified.
If a student takes a 'not' assessment and another test with the same student's name, Nothing, the student appears on the tests
An image of the database


result
my query not good result
SELECT STU_TB.[STU_ID], STU_TB.[STU_NAME], STU_TB.[STU_RATE], STU_TB.[STU_TEST] FROM STU_TB where stu_rate <>null and stu_name not in (select stu_name from stu_tb where stu_rate='NOT' or stu_rate=null group by stu_name HAVING COUNT(stu_name) > 1) order by stu_test;
Sql .bak
view