Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Need sql query

Author  Topic 

shishi
Starting Member

7 Posts

Posted - 2004-05-28 : 05:00:47
Hi,

A table contains information
of students & their marks
such as stud_id , stud_name , marks

I want to retrive first 10 ten top ranked
students name . Howz it done ?

Thanx in advance
shishi

srinivasanr
Starting Member

15 Posts

Posted - 2004-05-28 : 05:08:19
Hope this is you need...

SELECT TOP 10 stud_id, stud_name
FROM students_marks
ORDER BY marks DESC

Wallops!!!
Go to Top of Page

shishi
Starting Member

7 Posts

Posted - 2004-05-28 : 06:07:23
Hi Srini,

Thanx for ur quick reply .

But I need to retrieve only the
10 students who scored high
marks in order , not first 10 students.

Thanx in advance
shishi
Go to Top of Page

Pethron
Starting Member

10 Posts

Posted - 2004-05-28 : 06:27:22
Thats why it is ordered by marks, so the first 10 students are the 10 students whith the highest marks...
Go to Top of Page

shishi
Starting Member

7 Posts

Posted - 2004-05-28 : 06:31:21

Oh , Thanx for all the people
who helped me

- Shishi
Go to Top of Page
   

- Advertisement -