Aller au contenu

Renvoie 0 si les chaînes sont identiques, -1 si le premier argument est inférieur au second, et 1 sinon.

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>)
Arguments Description
<expr1> La chaîne.
<expr2> La chaîne.

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