3
Reply

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

Imran Kabir

16y
5.3k
0
Reply

    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.

    SELECT top 5 COUNT(StudentID), TotalMarks FROM AccountInfo GROUP BY TotalMarks ORDER BY TotalMarks DESC

    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.....