I have an exam table, my function is to want to make this table the error rate table is structured as follows:
id subjectid (foreign key, point to questions table here) content (the content of examination questions) is right (Whether or not right, 0 errors, 1 right)
1 101 subject content 0
2 101 subject content 0
3 101 subject of the contents of one
4 101 subject content of one
5 102 title of the contents of 0
6 102 Title 1
7 103 topics content 0
8 103 Title 1
9 103 Title 1
My idea is: first according to what subjectid group by group, and then concludes that the number of errors for each subject, but also appeared to draw the total number of each topic, (such as example of this is drawn on the total number of 101 errors for the 4 for two, so that the result will be displayed by)
And what sort, many of the mistake of standing in the front is equal order by clicking the wrong number,i did not want to for a long time to write the SQL to be grateful


Reply With Quote

Bookmarks