String Comparison Functions and Operators +--------------+ mysql>  SELECT filename, filename LIKE ’%\\’ FROM t1; +--------------+---------------------+ | filename | filename LIKE ’%\\’ | +--------------+---------------------+ | C: | 0 | | C:\ | 1 | | C:\Programs | 0 | | C:\Programs\ | 1 | +--------------+---------------------+ +--------------+-----------------------+ | filename | filename LIKE ’%\\\\’ | +--------------+-----------------------+ | C: | 0 | | C:\ | 1 | | C:\Programs | 0 | | C:\Programs\ | 1 | +--------------+-----------------------+ mysql>  SELECT filename, filename LIKE ’%\\\\’ FROM t1; To test for values that end with backslash, you can match the values using either of the following patterns: • expr  NOT LIKE  pat  [ESCAPE ’ escape_char ’] This is the same as  NOT ( expr  LIKE  pat  [ESCAPE ’ escape_char ’]) . Aggregate queries involving  NOT LIKE  comparisons with columns containing NULL  may yield unexpected results. For example, consider the following table and data: Note CREATE TABLE foo (bar VARCHAR(10)); INSERT INTO foo VALUES (NULL), (NULL); The query  SELECT COUNT(*) FROM foo WHERE bar LIKE ’%baz%’; returns  0 . You might assume that  SELECT COUNT(*) FROM foo WHERE bar NOT LIKE ’%baz%’;  would return  2 . However, this is not the case: The second query returns  0 . This is because  NULL NOT LIKE  expr  always returns  NULL , regardless of the value of  expr . The same is true for aggregate queries involving NULL  and comparisons using  NOT RLIKE  or  NOT REGEXP . In such cases, you must test explicitly for  NOT NULL  using  OR  (and not  AND ), as shown here: SELECT COUNT(*) FROM foo WHERE bar NOT LIKE ’%baz%’ OR bar IS NULL; • STRCMP( expr1 , expr2 ) mysql>  SELECT STRCMP(’text’, ’text2’); -> -1 mysql>  SELECT STRCMP(’text2’, ’text’); -> 1 mysql>  SELECT STRCMP(’text’, ’text’); 2189 STRCMP()  returns  0  if the strings are the same,  -1  if the first argument is smaller than the second according to the current sort order, and  1  otherwise.