This question asks about getting a random(ish) sample of records on SQL Server and the answer was to use TABLESAMPLE. Is there an equivalent in Oracle 10?
We were given and assignment to select only two records from the list of agents..i.e 2 random records for each agent over the span of a week etc.... and below is what we got and it works
with summary as (
Select Dbms_Random.Random As Ran_Number,
colmn1,
colm2,
colm3
Row_Number() Over(Partition By col2 Order By Dbms_Random.Random) As Rank
From table1, table2
Where Table1.Id = Table2.Id
Order By Dbms_Random.Random Asc)
Select tab1.col2,
tab1.col4,
tab1.col5,
From Summary s
Where s.Rank <= 2;