K
K
kr_ilya2020-08-03 18:38:41
PostgreSQL
kr_ilya, 2020-08-03 18:38:41

Is it possible to find out what value random returns in a request?

Is there any way to find out what value random() returns in a request?
For example, a simple query: For example, random () will return 0.7678943212 and the query will actually look like this: is it possible to find out this number? Maybe somewhere in the logs is highlighted?
SELECT * FROM items WHERE id >= 1000*random()
SELECT * FROM items WHERE id >= 1000*0.7678943212

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2020-08-03
@freeExec

SELECT *, rnd FROM items, (SELECT random() AS rnd) AS r WHERE id >= 1000*rnd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question