CREATE TABLE `staticcatalogue` (
`Source` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ‘‘,
`CreatedDate` datetime DEFAULT NULL,
`Val_tr` text CHARACTER SET utf8 COLLATE utf8_turkish_ci,
`Val_ro` text CHARACTER SET utf8 COLLATE utf8_romanian_ci,
`Val_gr` mediumtext CHARACTER SET greek,
`Val_ar` mediumtext CHARACTER SET cp1256,
`Val_fr` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
PRIMARY KEY (`Source`),
KEY `PermissionID` (`PermissionID`),
CONSTRAINT `staticcatalogue_ibfk_1` FOREIGN KEY (`PermissionID`) REFERENCES `permission` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=‘Static language catalogue‘
这个创建表的SQL语句里包含了很多的校对规则,当与其他表连接进行查询的时候,Source字段会区分大小写,其他字段的校对是....._ci,是不区分大小写的。若要比较时Source不区分大小写可以再比较语句后添加COLLATE utf8_general_ci,如......LEFT JOIN staticcatalogue x2 ON x2.Source = c.Name COLLATE utf8_general_ci
mysql默认是不区分大小写的。查看一个表的详细信息可以使用命令: show create table talename.
mysql校对规则引起的不区分大小写