165k views
4 votes
To select a random number of record in Oracle database, you will use which of the following to randomize the order first.

User Ishpreet
by
7.8k points

1 Answer

4 votes

Final answer:

To randomize the order of records in Oracle database, you can use the ORDER BY clause along with the RAND() function.

Step-by-step explanation:

Randomizing the Order in Oracle Database

To select a random number of records in Oracle database and randomize the order, you can use the ORDER BY clause in your query along with the RAND() function. For example, to select a random 10 records, you can use:

SELECT * FROM table_name ORDER BY RAND() LIMIT 10;

This query will order the records in a random order and limit the result to 10 records. Each time you run the query, you will get a different set of random records. This method works by generating a random number for each record in the table and then ordering them based on that random number.

User Matvey Aksenov
by
7.3k points