For this , its easy, just using RANDOM() built-in function in PostgreSQL

SELECT key_value FROM KEY_STORE ORDER BY RANDOM() limit 1;

Above example we will get a random key value from the table KEY_STORE . Everytime execute it will get a random score VALUE.

Laisser un commentaire