Imran Kabir
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?
By Imran Kabir in SQL Server on Apr 14 2008
  • xyz
    Jun, 2008 25

    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.

    • 0
  • Shani
    Apr, 2008 23

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

    • 0
  • shivendra gupta
    Apr, 2008 17

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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS