Interviews3 answers
How to retrive a student with height marks,second height and third height from MS access database what wil be the query for this purpuse?
Imran Kabir
Posted Apr 13, 2008, 11:42 PM EDT3 Answers
SELECT *
FROM result AS a
WHERE (((3)=(select count(marks) from result b where a.marks <= b.marks)));
REMARK: this query get's the THIRD highest mark placed in the table.
changing the row no. (numeric value) will give the corresponding record.
xyzPosted Jun 24, 2008, 8:43 PM EDT
SELECT top 5 COUNT(StudentID), TotalMarks
FROM AccountInfo
GROUP BY TotalMarks
ORDER BY TotalMarks DESC
Posted Apr 23, 2008, 6:21 AM EDT
For Heighest marks:-
------------------------
Select
* from Student s where 0=(Select count(*) from Student s1 where s1.marks > s.marks)For Second Heighest change the Condition like ' where 1=....'
Similarly For 3rd, 4th ...... and n'th hight, change the condition like
'where 2=...., 3=... .......... and (n-1)=.........'
Hope this will help u....
Thanks.....
shivendra guptaPosted Apr 17, 2008, 2:12 AM EDT
