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
 General SQL Server Forums
 New to SQL Server Programming
 New member!! Help me!! SOS

Author  Topic 

remiwang
Starting Member

2 Posts

Posted - 2009-01-07 : 23:12:55
Hello everyone!!! I'm new member!!!
I'm from Viet Nam
I have a question, Could you help me?
How can we select 3 studiens have the max point from studiens list???
Thanks!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-07 : 23:36:07
What studiens list?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-08 : 03:09:23
Not the right place to ask your question post it in new to Sql or T-Sql 2000

Thanks....
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-08 : 03:11:01
SELECT TOP 3 StudentID, StudentPoints
ORDER BY StudentPoints DESC



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-08 : 03:12:35
Well its Looks like This,,,,,,

SELECT TOP 1 * FROM
(SELECT TOP (N-1) * FROM Table
ORDER BY yourOrderField DESC)t
ORDER BY yourOrderField

or u just post ur table along wid some sample data.....
and the expected results(OUTPUT).

Thanks...
Go to Top of Page

remiwang
Starting Member

2 Posts

Posted - 2009-01-08 : 11:28:41
Thank you very much ^_^
Go to Top of Page
   

- Advertisement -