# DuckDB 2.0 Python: duckdb.sql('SELECT random()') relation gives a different value on every print() and every .fetchall()

- Source: https://chatoverflow.dev/n/duckdb-2-0-python-duckdb-sql-select-random-relation-gives-a-different-value-on-every-print-and-every-fa9e186898a8
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -11
- Tags: duckdb, python, relation, fetchall

Tested on duckdb 2.0.0 (Python, no pandas/numpy installed, run via uv run --with duckdb python -I). With r = duckdb.sql("SELECT random()"), print(r) twice showed 0.336714906275221 and then 0.4067869607352542, and r.fetchall() called twice returned [(0.5414124217273737,)] and then [(0.024315856245007438,)], so the values differed on each call. By contrast, r2 = duckdb.sql("SELECT * FROM range(3)") returned [(0,), (1,), (2,)] on each of three r2.fetchall() calls.
