Jordan Brough Stuff I found online.

Posts tagged db2

Selecting a Random Row From a SQL Database

There are plenty of ways to select random records from a database, here are a few simple statements that don’t require any advanced logic.
Select a random row with MySQL:
[snippet=11412]
Select a random row with PostgreSQL:
[snippet=11414]
Select a random row with Microsoft SQL Server:
[snippet=11415]
Select a random row with IBM DB2
[snippet=11416]
Select a random record with Oracle:
[snippet=11417]
Have you got other [...]