bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL STRCMP() Function

Example

SELECT STRCMP("SQL Tutorial",
  "SQL Tutorial");

Definition and Usage

The STRCMP() function compares two strings.

Syntax

STRCMP(
string1
,
string2
)

Parameter Values

ParameterDescription
string1, string2Required. The two strings to be compared

Return Values

  • If string1 = string2 , this function returns 0
  • If string1 < string2 , this function returns -1
  • If string1 > string2 , this function returns 1

Technical Details

Works in:From MySQL 4.0

Previous

MySQL SPACE() Function

Next

MySQL SUBSTR() Function