Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

STRCMP

Example

Assess the similarity between two strings.

SELECT STRCMP(“SQL Tutorial”“SQL Tutorial”); 

Definition and Usage

The STRCMP() function evaluates the relationship between two strings.

Syntax

STRCMP(string1string2)

Parameter Values

Parameter

Description

string1, string2

Necessary. The pair of strings for comparison.

Return Values

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

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Assess the relationship between two strings.

SELECT STRCMP(“SQL Tutorial”“HTML Tutorial”);