הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Applies to:
Databricks SQL
Databricks Runtime
Returns a bitwise signed right shifted by n bits.
Syntax
shiftright(expr, n)
Arguments
expr: AnINTEGERorBIGINTexpression.n: AnINTEGERexpression specifying the number of bits to shift.
Returns
The result type matches expr.
When expr is negative (that is, the highest order bit is set) the result remains negative because the highest order bit is sticky.
When n is negative the result is 0.
Examples
> SELECT shiftright(4, 1);
2
> SELECT shiftright(-4, 1);
-2