博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

mysql 1267 error

Posted on 2018-06-22 21:13  moss_tan_jun  阅读(498)  评论(0编辑  收藏  举报

CREATE TABLE a (
id VARCHAR(32)
) DEFAULT CHARSET = utf8 COLLATE utf8_general_ci;
INSERT INTO a(id) VALUES('a');

CREATE TABLE b (
id VARCHAR(32)
) DEFAULT CHARSET = utf8 COLLATE utf8_general_ci;
INSERT INTO b VALUES('b');

CREATE TABLE c (
id VARCHAR(32)
) DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci;
INSERT INTO c VALUES('c');

SELECT DISTINCT a.id,b.id FROM a,b WHERE a.id=b.id ORDER BY a.id DESC,b.id DESC;


SELECT CONCAT('ALTER TABLE ','c',' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') FROM information_schema.TABLES WHERE TABLE_SCHEMA='test001';

ALTER TABLE c CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

SELECT DISTINCT a.id,b.id,c.id FROM a,b,c WHERE a.id=b.id AND b.id=c.id ORDER BY a.id DESC,b.id DESC,c.id DESC;