I would like to get help understanding sql query in bigquery.
If I write query as below, this samples random 1% rows out of total rows which column DEP_DELAY are not null. Without RAND()
, total number of rows are 235208
.
SELECT COUNT(DEP_DELAY) FROM flights.fedtzcorr WHERE RAND() < 0.1
Reading the document, it says it creates fifteen digits of precision after the decimal point. So, literaly understanding, I thought RAND() creates 15 digit number
between 0
and 100,000,000,000,000
...
This function generates values of Decimal type with fifteen digits of precision after the decimal point.
How does RAND() sample 1% of rows from total number of rows ?