Przejdź do głównej zawartości

Zwraca 0, jeśli ciągi znaków są takie same, -1, jeśli pierwszy argument jest mniejszy od drugiego, a w pozostałych przypadkach 1.

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>)
Argumenty Opis
<expr1> Ciąg znaków.
<expr2> Ciąg znaków.

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 │
└────────────────────────┘