I'm trying to select random strings. The problem is it returns the same value for each row. Why is that and how to fix?
SELECT array_to_string(ARRAY(SELECT chr((48 + round(random() * 59)) :: integer)
FROM generate_series(1,40)), '') AS string FROM generate_series(1,10);
Output:
| string |
| duplicate |
| duplicate |
| duplicate |
...
10 rows