ORD (Lakehouse v1)
If the leftmost character is not a multibyte character, ORD() returns the same value as the ASCII() function.
If the leftmost character of the string str is a multibyte character, returns the code for that character, calculated from the numeric values of its constituent bytes using this formula:
(1st byte code)+ (2nd byte code * 256)+ (3rd byte code * 256^2) ...Analyze Syntax
Section titled “Analyze Syntax”func.ord(<str>)Analyze Examples
Section titled “Analyze Examples”func.ord('2')┌────────────────┐│ func.ord('2) │├────────────────┤│ 50 │└────────────────┘SQL Syntax
Section titled “SQL Syntax”ORD(<str>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<str> | The string. |
Return Type
Section titled “Return Type”BIGINT
SQL Examples
Section titled “SQL Examples”SELECT ORD('2')┌────────┐│ ORD(2) │├────────┤│ 50 │└────────┘