How to fetch in a limit between ids

i am using random function for fetching random result from my tables
but i want one more thing in that
i want to fetch just from 1 id to 1000
mean i want to give that a limit that fetch from in between these id randomly
how to write query ?

Really, what have you tried?

What server-side language are you using?

If your using PHP then one option would be to have your query match all needed records for what your after (leaving out the WHERE clause if you want all records to be chosen from). Then in PHP once you’ve got the result set into an array, you’d use the array_rand() function to grab x number of random rows from the results. I don’t know if asp, .net, etc have their own equivalent function to array_rand().

Have a read of this thread where the speed of different methods of getting random rows from a database are discussed.