STRCMP (Lakehouse v1)
Returns 0 if the strings are the same, -1 if the first argument is smaller than the second, and 1 otherwise.
Analyze Syntax
Section titled “Analyze Syntax”func.strcmp(<expr1> ,<expr2>)Analyze Examples
Section titled “Analyze Examples”func.strcmp('text', 'text2')┌──────────────────────────────┐│ func.strcmp('text', 'text2') │├──────────────────────────────┤│ -1 │└──────────────────────────────┘
func.strcmp('text2', 'text')┌──────────────────────────────┐│ func.strcmp('text2', 'text') │├──────────────────────────────┤│ 1 │└──────────────────────────────┘
func.strcmp('text', 'text')┌──────────────────────────────┐│ func.strcmp('text', 'text') │├──────────────────────────────┤│ 0 │└──────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”STRCMP(<expr1> ,<expr2>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<expr1> | The string. |
<expr2> | The string. |
Return Type
Section titled “Return Type”BIGINT
SQL Examples
Section titled “SQL Examples”SELECT STRCMP('text', 'text2');┌─────────────────────────┐│ STRCMP('text', 'text2') │├─────────────────────────┤│ -1 │└─────────────────────────┘
SELECT STRCMP('text2', 'text');┌─────────────────────────┐│ STRCMP('text2', 'text') │├─────────────────────────┤│ 1 │└─────────────────────────┘
SELECT STRCMP('text', 'text');┌────────────────────────┐│ STRCMP('text', 'text') │├────────────────────────┤│ 0 │└────────────────────────┘