How can i get a random row from a query result in PostgreSQL?
The answer is easy, just using RANDOM() built-in function in PostgreSQL

SELECT scoreid FROM n_score ORDER BY RANDOM() LIMIT 1;

Above example will get a random score id from table n_score. Everytime execute it will get a random score id. Done.

Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world\'s largest enterprise software company.
Publisher : Oracle Corporation