For some reasons you may want to select some random records from a table to perform some processing on them,  I will show how to Select random records in IBM DB2:

where n is the number of random records to return, MyTable is the table name.

An example to select 5 random names from names table: