·½·¨Ò»£º½¨Ò»¸öÆ´Òô±í t_cosler £¬´æ·Åÿ¸ö×Öĸ¿ªÍ·µÄµÚÒ»¸öºº×ֵıàºÅºÍ×îºóÒ»¸öºº×ֵıàºÅ¡£
BatchFile code
+------+--------+-------+
| f_PY | cBegin | cEnd |
+------+--------+-------+
| A | 45217 | 45252 |
| B | 45253 | 45760 |
.....
| Z | 54481 | 55289 |
+------+--------+-------+
È»ºóÖ±½Ó²éѯ¾ÍÐÐÁË¡£
SQL code
mysql> create table t_cosler(
-> f_PY char primary key,
-> cBegin SMALLINT UNSIGNED not null,
-> cEnd SMALLINT UNSIGNED not null
-> );
Query OK, 0 rows affected (0.09 sec)
mysql> insert into t_cosler values
-> ('A',0xB0A1,0xB0C4),
-> ('B',0xB0C5,0xB2C0),
-> ('C',0xB2C1,0xB4ED),
-> ('D',0xB4EE,0xB6E9),
-> ('E',0xB6EA,0xB7A1),
-> ('F',0xB7A2,0xB8C0),
-> ('G',0xB8C1,0xB9FD),
-> ('H',0xB9FE,0xBBF6),
-> ('J',0xBBF7,0xBFA5),
-> ('K',0xBFA6,0xC0AB),
-> ('L',0xC0AC,0xC2E7),
-> ('M',0xC2E8,0xC4C2),
-> ('N',0xC4C3,0xC5B5),
-> ('O',0xC5B6,0xC5BD),
-> ('P',0xC5BE,0xC6D9),
-> ('Q',0xC6DA,0xC8BA),
-> ('R',0xC8BB,0xC8F5),
-> ('S',0xC8F6,0xCBF9),
-> ('T',0xCBFA,0xCDD9),
-> ('W',0xCDDA,0xCEF3),
-> ('X',0xCEF4,0xD188),
-> ('Y',0xD1B9,0xD4D0),
-> ('Z',0xD4D1,0xD7F9);
Query OK, 23 rows affected (0.16 sec)
Records: 23 Duplicates: 0 Warnings: 0
mysql> select * from o_personnel;
+------+------------+
| A_Id | A_UserName |
+------+------------+
| 1 | Ê×ÏÈ |
| 2 | ¼ì²é |
| 3 | ÎÒÃÇ |
| 4 | µÄ¶þ |
| 5 | ½øÖÆ |
| 6 | ÊÇ·ñ |
| 7 | ÊÊºÏ |
| 8 | ÄãµÄ |
| 9 | ƽ̨ |
+------+------------+
9 rows in set (0.00 sec)
mysql> select p.*,c.*
-> from o_personnel p , t_cosler c
-> where CONV(HEX(left(A_UserName,1)),16,10) between c.cBegin and c.cEnd;
+------+------------+------+--------+-------+
| A_Id | A_UserName | f_PY |
²î²»¶àÔÚÒ»ÄêÇ°£¬Ð´¹ýһƪÎÄÕ½éÉܽ«MySQLÊý¾ÝÓ³Éäµ½Memcached£¬µ±Ê±MySQLºÍMemcached Functions for MySQL¶¼»¹²»¹»³ÉÊ죬ʱ¹ýÒ»Ä꣬Memcached Functions for MySQLÉý¼¶µ½ÁË0.8°æ±¾£¬¶øMySQLÒ²·¢²¼ÁËGA°æ±¾£¬¼ÓÉϺܶàÅóÓÑ·´Ó¦Ç°Ò»ÆªÎÄÕÂÖеÄʵÏÖËûÃÇÒòÖÖÖÖÔÒòûÄܳɹ¦£¬ÓÚÊDZãÓÐÁËÕâƪÎÄÕ£¬¾Íµ±ÊÇÉÏһƪÎÄÕµÄÉý¼¶°æ±¾°É¡ ......
ºÃ¾ÃûÓÐÕûÀí¶«Î÷£¬¸Ð¾õ×Ô¼ºÔ½À´Ô½ÀÁ£¬ÕýºÃ½üÆÚÓиöMYSQLµÄÏîÄ¿£¨Ò»¸öORACLEµÄÓ¦ÓÃǨÒƵ½MYSQL£©£¬ÒÔǰûÓнӴ¥¹ýMYSQL£¬µ«ÊÇÒ²ÖªµÀMYSQLÊý¾Ý¿âÄ¿Ç°¹ã·ºµÄÓ¦ÓÃÔÚ¸÷ÖÖ¸öÈË¡¢ÉÌÎñϵͳÖУ¬¸÷ÖÖ¼¼Êõ¶¼±È½Ï³ÉÊì¡£°Ñ×Ô¼ºÑ§Ï°µÄһЩ¹ý³Ì×ܽáһϣ¬¸ÃÎÄÕÂÉè¼Æµ½µÄÄÚÈݶ¼Ã»ÓÐ×öÌ«ÏêϸµÄ²ûÊö£¬Ö»ÊÇÒ»¸ö¼òµ¥µÄÈëÃÅÊֲᡣ
  ......
* mysqlÊ×ÏȽ«Äõ½µÄÊý¾Ýת»»Îªcharacter_set_clientÖ¸¶¨µÄ±àÂë¸ñʽ£¬È»ºóת»»Îª character_set_connectionÖ¸¶¨µÄ¸ñʽ£¬×îºóÔÙ½«Êý¾Ý´æ´¢µ½Êý¾Ý¿â£¬´æ´¢¸ñʽΪcharacter_set_databaseËùÖ¸¶¨µÄ¸ñʽ£»
* ´ÓÊý¾Ý¿â¶ÁÊý¾Ýʱ£¬½«Êý¾Ý¿â¸ñʽת»»Îªcharacter_set_resultsÖ¸¶¨µÄ¸ñʽ£¬ÔÙ·¢Ë ......