Pular para o conteúdo

Devolve 0 se as cadeias de caracteres forem iguais, -1 se o primeiro argumento for menor do que o segundo e 1 caso contrário.

func.strcmp(<expr1> ,<expr2>)
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 │
└──────────────────────────────┘
STRCMP(<expr1> ,<expr2>)
Argumentos Descrição
<expr1> A cadeia de caracteres.
<expr2> A cadeia de caracteres.

BIGINT

SELECT STRCMP('text', 'text2');
┌─────────────────────────┐
│ STRCMP('text', 'text2') │
├─────────────────────────┤
│ -1 │
└─────────────────────────┘
SELECT STRCMP('text2', 'text');
┌─────────────────────────┐
│ STRCMP('text2', 'text') │
├─────────────────────────┤
│ 1 │
└─────────────────────────┘
SELECT STRCMP('text', 'text');
┌────────────────────────┐
│ STRCMP('text', 'text') │
├────────────────────────┤
│ 0 │
└────────────────────────┘