|
-
Apr 8th, 2003, 10:15 PM
#1
Thread Starter
Member
OleDB Commands
"Select * from Scores order by Score DESC"
I've this line of command that retrive everything from the Scores database sorting by the Score in decending order. Is there anyway that I could only retrive the first 10 entry when it's in decending, thus retriving only the top 10?
[EDIT]
Eh! I've another idea, how do I limit the database to 10 records ONLY? So if I've a new score that is higher than the lowest score in the database. It'll kick out the lower score and put itself in it's place?
I've a idea of using Array taking all the 10 results and comparing which the lowest, (I dunno how to compare 10 results) and putting it back in.
Hope someone understands!
[/EDIT]
Last edited by LuvKnight; Apr 8th, 2003 at 10:30 PM.
-
Apr 9th, 2003, 01:54 AM
#2
Addicted Member
select top 10 * from scores order by score desc
to delete you could use something like this (you need a primary key):
delete from scores
where id not in (select top 10 id from scores order by score desc)
-
Apr 9th, 2003, 02:02 AM
#3
Thread Starter
Member
Thanks!
But is there any way to keep the database to only 10 entries? When adding a new entry, I must get the LBound and compare with the current score. Any idea?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|