Home > database >  SQL query about Chinese characters, abnormal results
SQL query about Chinese characters, abnormal results

Time:10-06

Don't know whether you the problem of character set or mysql mandarin is not standard, I found a problem in the following statement:
Select * from China where city like "Ren Qiu %" limit 10;

Select * from China where city like "Ren Qiu %" limit 10;
Select * from China where city like "shangqiu %" limit 10;
The results of the two statements is the same,
A similar situation is as follows:
Select * from China where city="wenzhou"
Select * from China where city="wuzhou"
Linhai city longhai city
Yiyang city zaoyang
Wenzhou wuzhou
Strange query,,,
Do not know to have encountered the same problem friends ~
 
-
- table structure ` China `
-

The CREATE TABLE ` China ` (
` Id ` int (11) NOT NULL,
` Name ` varchar (40) default NULL,
` Pid ` int (11) the default NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-
- export the data in the table ` China `
-

INSERT INTO ` China ` VALUES (330300, wenzhou, 330000);
INSERT INTO ` China ` VALUES (450400, 'China,', 450000);


The following is the query result

CodePudding user response:

The database code:
  • Related