Archive

Archive for February, 2010

[PLSQL] Select a random row from a database table

Friday, 5 February, 2010 1 comment

There is some way to select a random record or row from a database table.

SELECT col1, col2, col3  FROM (SELECT * FROM tcard SAMPLE(1) ORDER BY dbms_random.VALUE)
          WHERE branch = 1
                CANCELDATE > SYSDATE
                AND ROWNUM <= 100);
Categories: PL/SQL Tags: , ,

[PL\SQL] Select a random row from a database table

Friday, 5 February, 2010 1 comment

There is some way to select a random record or row from a database table.

SELECT col1, col2, col3  FROM (SELECT * FROM tcard SAMPLE(1) ORDER BY dbms_random.VALUE)
          WHERE branch = 1
                CANCELDATE > SYSDATE
                AND ROWNUM <= 100);
Categories: PL/SQL Tags: , ,