ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 31st, 2007, 12:43 AM
cancer10 cancer10 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Location: India
Posts: 41 cancer10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 24 m 53 sec
Reputation Power: 12
Send a message via ICQ to cancer10 Send a message via AIM to cancer10 Send a message via MSN to cancer10 Send a message via Yahoo to cancer10
Question ASP- SQL Server..Query help....

Hello,

I am using ASP and MS SQL Sever 2000 as backend database..

I am writing a SQL query which will pick up top 5 student details who have scored the highest marks from the following table

tblstudents -

Code:
 ID | iTotal 


The following points to be noted:

-The table has 500 records.
- 50 of them have achieved the highest marks ie 100 marks each
- My following query is picking up top 5 records who have scored 100 marks

Code:
SELECT TOP 5 ID, iTotal
FROM tblstudents 
ORDER BY iTotal DESC


and getting this output:




Now my question is:

On what basis its showing up this sequence of listing? I mean why the ID 89 is on the top and 286 at the bottom? Why the ID is not the other way round?

Like the following?

ID
__
178
239
89
286
247

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ASP- SQL Server..Query help....


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap