MySQL is case-insensitive by default. this involves the knowledge of the collate character set and validation rules. we will discuss the case-insensitive method for MySQL to query time zone strings. if you insert two rows of values 'A' and 'A' in A column with a unique constraint on mysql, Mysql considers it to be the same, but it does not exist in oracle. Is the default mysql field value case insensitive? This is a headache. Directly use the client to query the database using SQL. It is found that the size is not sensitive.
You need to set collate by querying the data ).
Collate rules:
* _ Bin: binary case sensitive collation, that is, case sensitive.
* _ Cs: case sensitive collation, case sensitive
* _ Ci: case insensitive collation, case insensitive
Mysql can:
1. use character sets to store strings and support multiple character sets;
2. use verification rules to compare strings. you can use multiple verification rules to compare the same character set;
3. use different character sets or verification rules in the same server, database, or even table to mix character strings;
4. different character sets and verification rules can be defined at any level (server, database, table, field, string.
Case Sensitive
You can use the binary keyword. There are two methods:
First: make mysql Query time zone Case Sensitive
select * from usertable where binary id='AAMkADExM2M5NjQ2LWUzYzctNDFkMC1h';
Type 2: identify a table during table creation
create table `usertable`( `id` varchar(32) binary, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Or
CREATE TABLE `usertable` ( `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
In mysql, case sensitivity issues exist:
(1) Keywords: case-insensitive select * fRom table_name and select * from table_name
(2) identifier (such as database name and table name): case-insensitive. If the users table exists, select * from users and select * from uSers have the same effect. This is related to the operating system. all Unit operating systems (except for Mac OS using HFS +) are case sensitive, while windows systems are case insensitive. (This statement has not been verified on the internet. I am case insensitive on windows server2003)
(3) table alias: case-insensitive select m. * from users m where M. username = 'a ';
(4) column alias: case-insensitive select uName from (select username as uname from users where id = 768 );
The above is a detailed description of the MySQL Query time zone string in case-sensitive method _ MySQL content, for more information, please follow the PHP Chinese network (www.php1.cn )!