-
[Req]Top 3 recodes .......!!!
Hi there,this is my first request in this forum,i hope i will get reply soon,now the problem,i want to know the Top 3 "Student" record of each "Class" with each "Section".e.g
=======================================
roll# Class Name Section Rank
23 1 Nabil A 1
31 1 Tori A 2
43 1 Jeff A 3
20 1 Mark B 1
03 1 Habe B 2
. . . . .
. . . . .
. . . . .
04 10 Xyz - 1
76 10 Abc - 2
04 10 Sdf - 3
=======================================
So in this way i can see the summary of the Top Student in the School by listing the Top 3 student of each class.
-
Top 3 Students
Is Rank a field or is it the ordinal rank of the student based on the value of field such as 'Score'? Without that information no can do.
Again, Top 3 what????
HTH,
Peter
-
well yes Rank is the Field which depent upon the value of "Marks_Obtain",and by "Top 3" i mean the record of the Position holder student's in the class...the record is gevin below:
roll#,name,f_name,class,sec(if there is any),Total_Marks,Marks_Obtain,Percentage,Grade,Ran k.
and from this database i want to know the Top 3 student of each class,with there section(If there is any section of the class).I hope now it's easy to understant.take care.
-
TOP X
Hi Cool Moon,
Before we begin, Name is a bad name for a field. It is a reserved word in Access and should be renamed StudentName or somesuch.
Also avoid the use of characters such as # etc, they may end up confusing the database at inappropriate times.
SELECT S.StudentName, S.StudentClass, S.Section, S.MarkObtained
FROM Students as S
WHERE S.RollNumber In (SELECT TOP 3 SR.RollNumber FROM Students as SR WHERE (SR.StudentClass = S.StudentClass) ORDER BY MarkObtained DESC)
ORDER BY S.StudentClass,S.MarkObtained DESC
I have assumed that RollNumber is the Primary Key, if not the query will not work but you should get the gist of how it's done.
HTH,
Peter
-
Thanx PinkPanther,now it's working just fine and also thanx for the advise,now i will change the field name to a more suitable names,take care and God Bless You.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|