January 31st, 2007, 12:43 AM
Join Date: Oct 2006
Time spent in forums: 5 h 24 m 53 sec
Reputation Power: 13
ASP- SQL Server..Query help....
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
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
SELECT TOP 5 ID, iTotal
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?