I have written about using SQL's RAND() to generate random numbers to be included in the returned results, but not to return a fixed number of randomly selected results. In other words I just want five randomly selected rows returned in the results.
In this example I have a file, and yes it is a DDS file, that contains just two fields:
- COMPANY: company number
- VALUE: a three long numeric field
For company number 1 there are twenty records with the sequential values 1 – 20.
The request is for, let's say, five randomly selected records for company number 1 only.