適用対象:
Databricks SQL
Databricks Runtime 16.1 以降
length の長さの英数字のランダムな文字列を返します。
構文
randstr ( length [, seed] )
議論
-
length: 結果文字列の長さを指定するSMALLINTまたはINT定数の負でない式。 -
seed: 省略可能なSMALLINT、またはランダムな文字列生成のシードとして機能するINT式。
戻り値
文字 STRING、a-z、および A-Zで構成される 0-9。
例示
> SELECT randstr(10), randstr(10);
Xn2IiSepLX w3F34omh1C
-- Using a fixed seed, the outcome is deterministic series of random strings.
> SELECT randstr(10, 0), randstr(10, 0) FROM VALUES(1), (2), (3);;
ceV0PXaR2I ceV0PXaR2I
lBhHi56d0u lBhHi56d0u
CtuwSOTLiL CtuwSOTLiL