Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Number limiting query

$
0
0
In table1 students lectures data are stored as:
Code:

ID    studentname      lecturesubject      lecturedate
1        steve            politics          3/2/2013
2        jack            politics          3/2/2013
3        steve            math              5/2/2013
4        steve            politics          7/2/2013
5        jack            politics          8/2/2013
6        steve            math              8/2/2013
7        jack            politics          9/2/2013
8        steve            politics          10/2/2013
9        steve            math              11/2/2013
10        steve            physics          12/2/2013
11        jack            politics          15/2/2013

We need a query that allows each student to preset a limited number of lectures on a specific subject. For example each student can provide only two lectures on a subject and any more lectures on the same subject presented by him will not be counted. In the above example records 7 8 9 and 11 will not be shown in the query.
Thank you

Viewing all articles
Browse latest Browse all 13329

Trending Articles