Notice: session_start(): A session had already been started - ignoring in /home/u614325693/domains/onedoubt.com/public_html/post.php on line 3
STRCMP - ONEDOUBT.COM

Example

Compare two strings:

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

Definition and Usage

The STRCMP() function compares two strings.

Syntax

STRCMP(string1, string2)

Parameter Values

Parameter Description
string1, string2 Required. 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

More Examples

Example

Compare two strings:

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


Login
ADS CODE