下面是我必須轉換為雪花的 oracle sql 查詢。在這里,我被阻止在雪花中創建 dbms_random.value()
select emp_id, emp_name, emp_mob,
(case when dbms_random.value() >= 0.85 then 'Y' else 'N' end) as tag
from eds_dwg.employee_data
有人可以幫我嗎?
謝謝
uj5u.com熱心網友回復:
您可以使用雪花資料生成函式:https ://docs.snowflake.com/en/sql-reference/functions-data-generation.html
NORMAL() 回傳具有指定均值和標準差的浮點數。像這樣正確調整引數的東西可以解決問題:https ://docs.snowflake.com/en/sql-reference/functions/normal.html
另一種方法是使用 UNIFORM():https ://docs.snowflake.com/en/sql-reference/functions/uniform.html
來自檔案的示例生成 0 到 1 之間的值:
select uniform(0::float, 1::float, random()) from table(generator(rowcount => 5));
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/414321.html
標籤:
