I was playing around with PL/SQL in order to solve a problem. We need to retrieve a random sample of 1% of 1,000,000 recs. I was thinking about saving 10,000 random values - between 1 and 1 million - to a GLOBAL TEMPORARY TABLE, or saving the same values in a PL/SQL table.
Then, I'd write a cursor against the 1 million record table, bringing in rownum, and then for each row check to see if that rownum was the 10,000 random values.
Is there a method that ya'll use regularly that is better than this? I don't mind finishing it, it's fun to figure these things out, but I'd rather spend the time to implement a better sol'n.