-
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]
-
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)
-
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?