دنبال کننده ها

۱۳۹۶ آذر ۱۰, جمعه

sql - Google BigQuery - Bug using WITH and RAND()

[ad_1]



I came upon an interesting behaviour when I use RAND() within WITH:



 WITH
t0 AS ( SELECT rand() AS c ),
t1 AS ( SELECT c FROM t0 ),
t2 AS ( SELECT c FROM t0 )

SELECT c FROM t2
UNION ALL
SELECT c FROM t2

--
-- returns:
-- 1 0.229810680294245
-- 2 0.5750437237982657
-- instead of:
-- 1 0.229810680294245
-- 2 0.229810680294245
--


Any clues why that happens?




[ad_2]

لینک منبع