right function (Databricks SQL)

Returns the rightmost len characters from the string str.

Syntax

right(str, len)

Arguments

  • str: A STRING expression.

  • len: An integral number expression.

Returns

A STRING.

If len is less or equal than 0, an empty string.

Examples

> SELECT right('Spark SQL', 3);
 SQL