DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(mysql.info.gz) Case sensitivity

Info Catalog (mysql.info.gz) Query Issues (mysql.info.gz) Query Issues (mysql.info.gz) Using DATE
 
 A.5.1 Case Sensitivity in Searches
 ----------------------------------
 
 By default, MySQL searches are not case sensitive (although there are
 some character sets that are never case insensitive, such as `czech').
 This means that if you search with `COL_NAME LIKE 'a%'', you will get
 all column values that start with `A' or `a'. If you want to make this
 search case sensitive, make sure that one of the operands is a binary
 string.  You can do this with the `BINARY' operator. Write the
 condition as either `BINARY COL_NAME LIKE 'a%'' or `COL_NAME LIKE
 BINARY 'a%''.
 
 If you want a column always to be treated in case-sensitive fashion,
 declare it as `BINARY'.  `CREATE TABLE' CREATE TABLE.
 
 Simple comparison operations (`>=, >, =, <, <=', sorting, and grouping)
 are based on each character's "sort value." Characters with the same
 sort value (such as `E', `e', and `e'') are treated as the same
 character.
 
 If you are using Chinese data in the so-called `big5' encoding, you
 want to make all character columns `BINARY'. This works because the
 sorting order of `big5' encoding characters is based on the order of
 ASCII codes. As of MySQL 4.1, you can explicitly declare that a column
 should use the `big5' character set:
 
      CREATE TABLE t (name CHAR(40) CHARACTER SET big5);
 
Info Catalog (mysql.info.gz) Query Issues (mysql.info.gz) Query Issues (mysql.info.gz) Using DATE
automatically generated byinfo2html