Use a SERIAL id on messages, then

Select * from messages
where id = int8( random() * currval({sequence_name}));

Arnau Rebassa wrote:

Hi everybody,

I'm doing the following query:

  select * from messages order by random() limit 1;

in the table messages I have more than 200 messages and a lot of times, the message retrieved is the same. Anybody knows how I could do a more "random" random?

Thank you very much

--
Arnau

_________________________________________________________________
Consigue aquí las mejores y mas recientes ofertas de trabajo EE.UU. http://latino.msn.com/empleos



---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

Reply via email to