1.创建表
-- sys.pinyintable definition
CREATE TABLE `pinyintable` (
`id` int NOT NULL,
`pin_yin` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
2.插入数据
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(1,'a','20319');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(2,'ai','20317');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(3,'an','20304');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(4,'ang','20295');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(5,'ao','20292');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(6,'ba','20283');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(7,'bai','20265');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(8,'ban','20257');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(9,'bang','20242');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(10,'bao','20230');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(11,'bei','20051');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(12,'ben','20036');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(13,'beng','20032');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(14,'bi','20026');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(15,'bian','20002');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(16,'biao','19990');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(17,'bie','19986');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(18,'bin','19982');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(19,'bing','19976');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(20,'bo','19805');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(21,'bu','19784');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(22,'ca','19775');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(23,'cai','19774');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(24,'can','19763');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(25,'cang','19756');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(26,'cao','19751');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(27,'ce','19746');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(28,'ceng','19741');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(29,'cha','19739');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(30,'chai','19728');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(31,'chan','19725');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(32,'chang','19715');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(33,'chao','19540');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(34,'che','19531');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(35,'chen','19525');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(36,'cheng','19515');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(37,'chi','19500');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(38,'chong','19484');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(39,'chou','19479');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(40,'chu','19467');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(41,'chuai','19289');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(42,'chuan','19288');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(43,'chuang','19281');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(44,'chui','19275');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(45,'chun','19270');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(46,'chuo','19263');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(47,'ci','19261');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(48,'cong','19249');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(49,'cou','19243');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(50,'cu','19242');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(51,'cuan','19238');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(52,'cui','19235');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(53,'cun','19227');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(54,'cuo','19224');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(55,'da','19218');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(56,'dai','19212');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(57,'dan','19038');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(58,'dang','19023');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(59,'dao','19018');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(60,'de','19006');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(61,'deng','19003');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(62,'di','18996');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(63,'dian','18977');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(64,'diao','18961');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(65,'die','18952');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(66,'ding','18783');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(67,'diu','18774');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(68,'dong','18773');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(69,'dou','18763');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(70,'du','18756');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(71,'duan','18741');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(72,'dui','18735');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(73,'dun','18731');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(74,'duo','18722');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(75,'e','18710');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(76,'en','18697');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(77,'er','18696');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(78,'fa','18526');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(79,'fan','18518');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(80,'fang','18501');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(81,'fei','18490');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(82,'fen','18478');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(83,'feng','18463');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(84,'fo','18448');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(85,'fou','18447');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(86,'fu','18446');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(87,'ga','18239');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(88,'gai','18237');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(89,'gan','18231');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(90,'gang','18220');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(91,'gao','18211');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(92,'ge','18201');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(93,'gei','18184');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(94,'gen','18183');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(95,'geng','18181');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(96,'gong','18012');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(97,'gou','17997');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(98,'gu','17988');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(99,'gua','17970');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(100,'guai','17964');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(101,'guan','17961');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(102,'guang','17950');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(103,'gui','17947');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(104,'gun','17931');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(105,'guo','17928');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(106,'ha','17922');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(107,'hai','17759');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(108,'han','17752');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(109,'hang','17733');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(110,'hao','17730');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(111,'he','17721');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(112,'hei','17703');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(113,'hen','17701');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(114,'heng','17697');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(115,'hong','17692');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(116,'hou','17683');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(117,'hu','17676');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(118,'hua','17496');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(119,'huai','17487');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(120,'huan','17482');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(121,'huang','17468');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(122,'hui','17454');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(123,'hun','17433');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(124,'huo','17427');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(125,'ji','17417');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(126,'jia','17202');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(127,'jian','17185');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(128,'jiang','16983');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(129,'jiao','16970');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(130,'jie','16942');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(131,'jin','16915');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(132,'jing','16733');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(133,'jiong','16708');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(134,'jiu','16706');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(135,'ju','16689');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(136,'juan','16664');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(137,'jue','16657');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(138,'jun','16647');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(139,'ka','16474');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(140,'kai','16470');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(141,'kan','16465');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(142,'kang','16459');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(143,'kao','16452');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(144,'ke','16448');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(145,'ken','16433');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(146,'keng','16429');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(147,'kong','16427');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(148,'kou','16423');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(149,'ku','16419');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(150,'kua','16412');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(151,'kuai','16407');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(152,'kuan','16403');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(153,'kuang','16401');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(154,'kui','16393');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(155,'kun','16220');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(156,'kuo','16216');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(157,'la','16212');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(158,'lai','16205');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(159,'lan','16202');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(160,'lang','16187');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(161,'lao','16180');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(162,'le','16171');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(163,'lei','16169');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(164,'leng','16158');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(165,'li','16155');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(166,'lia','15959');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(167,'lian','15958');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(168,'liang','15944');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(169,'liao','15933');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(170,'lie','15920');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(171,'lin','15915');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(172,'ling','15903');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(173,'liu','15889');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(174,'long','15878');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(175,'lou','15707');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(176,'lu','15701');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(177,'lv','15681');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(178,'luan','15667');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(179,'lue','15661');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(180,'lun','15659');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(181,'luo','15652');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(182,'ma','15640');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(183,'mai','15631');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(184,'man','15625');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(185,'mang','15454');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(186,'mao','15448');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(187,'me','15436');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(188,'mei','15435');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(189,'men','15419');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(190,'meng','15416');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(191,'mi','15408');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(192,'mian','15394');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(193,'miao','15385');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(194,'mie','15377');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(195,'min','15375');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(196,'ming','15369');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(197,'miu','15363');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(198,'mo','15362');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(199,'mou','15183');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(200,'mu','15180');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(201,'na','15165');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(202,'nai','15158');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(203,'nan','15153');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(204,'nang','15150');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(205,'nao','15149');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(206,'ne','15144');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(207,'nei','15143');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(208,'nen','15141');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(209,'neng','15140');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(210,'ni','15139');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(211,'nian','15128');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(212,'niang','15121');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(213,'niao','15119');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(214,'nie','15117');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(215,'nin','15110');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(216,'ning','15109');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(217,'niu','14941');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(218,'nong','14937');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(219,'nu','14933');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(220,'nv','14930');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(221,'nuan','14929');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(222,'nue','14928');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(223,'nuo','14926');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(224,'o','14922');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(225,'ou','14921');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(226,'pa','14914');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(227,'pai','14908');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(228,'pan','14902');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(229,'pang','14894');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(230,'pao','14889');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(231,'pei','14882');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(232,'pen','14873');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(233,'peng','14871');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(234,'pi','14857');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(235,'pian','14678');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(236,'piao','14674');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(237,'pie','14670');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(238,'pin','14668');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(239,'ping','14663');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(240,'po','14654');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(241,'pu','14645');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(242,'qi','14630');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(243,'qia','14594');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(244,'qian','14429');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(245,'qiang','14407');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(246,'qiao','14399');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(247,'qie','14384');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(248,'qin','14379');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(249,'qing','14368');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(250,'qiong','14355');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(251,'qiu','14353');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(252,'qu','14345');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(253,'quan','14170');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(254,'que','14159');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(255,'qun','14151');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(256,'ran','14149');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(257,'rang','14145');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(258,'rao','14140');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(259,'re','14137');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(260,'ren','14135');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(261,'reng','14125');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(262,'ri','14123');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(263,'rong','14122');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(264,'rou','14112');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(265,'ru','14109');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(266,'ruan','14099');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(267,'rui','14097');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(268,'run','14094');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(269,'ruo','14092');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(270,'sa','14090');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(271,'sai','14087');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(272,'san','14083');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(273,'sang','13917');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(274,'sao','13914');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(275,'se','13910');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(276,'sen','13907');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(277,'seng','13906');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(278,'sha','13905');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(279,'shai','13896');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(280,'shan','13894');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(281,'shang','13878');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(282,'shao','13870');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(283,'she','13859');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(284,'shen','13847');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(285,'sheng','13831');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(286,'shi','13658');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(287,'shou','13611');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(288,'shu','13601');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(289,'shua','13406');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(290,'shuai','13404');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(291,'shuan','13400');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(292,'shuang','13398');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(293,'shui','13395');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(294,'shun','13391');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(295,'shuo','13387');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(296,'si','13383');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(297,'song','13367');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(298,'sou','13359');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(299,'su','13356');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(300,'suan','13343');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(301,'sui','13340');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(302,'sun','13329');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(303,'suo','13326');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(304,'ta','13318');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(305,'tai','13147');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(306,'tan','13138');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(307,'tang','13120');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(308,'tao','13107');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(309,'te','13096');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(310,'teng','13095');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(311,'ti','13091');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(312,'tian','13076');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(313,'tiao','13068');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(314,'tie','13063');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(315,'ting','13060');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(316,'tong','12888');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(317,'tou','12875');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(318,'tu','12871');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(319,'tuan','12860');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(320,'tui','12858');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(321,'tun','12852');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(322,'tuo','12849');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(323,'wa','12838');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(324,'wai','12831');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(325,'wan','12829');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(326,'wang','12812');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(327,'wei','12802');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(328,'wen','12607');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(329,'weng','12597');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(330,'wo','12594');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(331,'wu','12585');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(332,'xi','12556');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(333,'xia','12359');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(334,'xian','12346');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(335,'xiang','12320');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(336,'xiao','12300');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(337,'xie','12120');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(338,'xin','12099');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(339,'xing','12089');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(340,'xiong','12074');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(341,'xiu','12067');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(342,'xu','12058');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(343,'xuan','12039');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(344,'xue','11867');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(345,'xun','11861');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(346,'ya','11847');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(347,'yan','11831');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(348,'yang','11798');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(349,'yao','11781');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(350,'ye','11604');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(351,'yi','11589');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(352,'yin','11536');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(353,'ying','11358');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(354,'yo','11340');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(355,'yong','11339');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(356,'you','11324');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(357,'yu','11303');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(358,'yuan','11097');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(359,'yue','11077');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(360,'yun','11067');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(361,'za','11055');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(362,'zai','11052');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(363,'zan','11045');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(364,'zang','11041');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(365,'zao','11038');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(366,'ze','11024');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(367,'zei','11020');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(368,'zen','11019');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(369,'zeng','11018');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(370,'zha','11014');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(371,'zhai','10838');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(372,'zhan','10832');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(373,'zhang','10815');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(374,'zhao','10800');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(375,'zhe','10790');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(376,'zhen','10780');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(377,'zheng','10764');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(378,'zhi','10587');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(379,'zhong','10544');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(380,'zhou','10533');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(381,'zhu','10519');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(382,'zhua','10331');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(383,'zhuai','10329');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(384,'zhuan','10328');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(385,'zhuang','10322');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(386,'zhui','10315');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(387,'zhun','10309');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(388,'zhuo','10307');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(389,'zi','10296');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(390,'zong','10281');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(391,'zou','10274');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(392,'zu','10270');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(393,'zuan','10262');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(394,'zui','10260');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(395,'zun','10256');
INSERT INTO sys.pinyintable(id, pin_yin, code) VALUES(396,'zuo','10254');
3.创建函数
Create Function sys.to_pinyin (NAME VARCHAR(255) CharSet gbk) RETURNS Varchar(255) CHARSet gbk
Begin
Declare mycode INT ;
Declare tmp_lcode Varchar(2) CHARSet gbk ;
Declare lcode INT ;
Declare tmp_rcode Varchar(2) CHARSet gbk ;
Declare rcode INT ;
Declare mypy Varchar(255) CHARSet gbk DEFAULT '' ;
Declare lp INT ;
Set mycode = 0 ;
Set lp = 1 ;
Set NAME = HEX(NAME) ;
While lp < LENGTH(NAME) DO
Set tmp_lcode = SUBSTRING(NAME, lp, 2) ;
Set lcode = CAST(ASCII(UNHEX(tmp_lcode)) AS UNSIGNED) ;
Set tmp_rcode = SUBSTRING(NAME, lp + 2, 2) ;
Set rcode = CAST(ASCII(UNHEX(tmp_rcode)) AS UNSIGNED) ;
IF lcode > 128 THEN
Set mycode = 65536 - lcode * 256 - rcode ;
Select CONCAT(mypy, pin_yin) Into mypy From sys.pinyintable Where code >= Abs(mycode) Order By code Asc Limit 1;
Set lp = lp + 4 ;
Else
Set mypy = Concat(mypy,Char(Cast(Ascii(UNHEX(SUBSTRING(NAME, lp, 2))) AS UNSIGNED)));
Set lp = lp + 2 ;
End If;
End While;
Return Lower(mypy) ;
End;
Select sys.to_pinyin("中国") From Dual;
--结果
zhongguo