·½·¨Ò»£º½¨Ò»¸öÆ´Òô±í t_cosler £¬´æ·Åÿ¸ö×Öĸ¿ªÍ·µÄµÚÒ»¸öºº×ֵıàºÅºÍ×îºóÒ»¸öºº×ֵıàºÅ¡£
BatchFile code+------+--------+-------+
| f_PY | cBegin | cEnd |
+------+--------+-------+
| A | 45217 | 45252 |
| B | 45253 | 45760 |
.....
| Z | 54481 | 55289 |
+------+--------+-------+
È»ºóÖ±½Ó²éѯ¾ÍÐÐÁË¡£
SQL codemysql> 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 | cBegi
´óÅúÁ¿²åÈëÊý¾Ýʱ 1,myisam±í,¿ÉÒÔÏÈͨ¹ý alter table table_name disable keys;#ÏȹرձíµÄË÷Òý¼ì²é,×¢ÒâÊÇ·ÇΨһË÷Òý! load data infile ¡®/path/file¡¯ into table table_name; alter table table_name anable keys;#ÔÙ´ò¿ªË÷Òý ¿É´ó´ó¼Ó¿ìµ¼Èë.»¹ÓпÉÒÔÉèÖÃbulk_insert_buffer_sizeÖµÀ´Ìá¸ß²åÈëËÙ¶È ......
´óÈýÏÂѧÆÚ£¬ÎÒ½Ó´¥µ½ÁËPHP£¬Ñ§ÁËÒ»µã»ù±¾µÄÓï·¨£¬ÒòΪ¸úCµÄÓï·¨ºÜÏñ£¬ËùÒÔѧÆðÀ´ºÜÊ¡Á¦¡£½¥½¥µØÎÒϲ»¶ÉÏÁËPHPÕâÃÅÓïÑÔ£¬ÒòΪÓÃËü¿ÉÒÔ×öÍøÕ¾£¬µ½ÁË´óËÄÎÒ±ã¸ü¼ÓÉîÈëµØѧPHPÁË£¬Ñ§Ï°ÓÃPHP×ö¶«Î÷³ÉÁËÎÒÉú»îÖеÄÒ»²¿·Ö...............
PHPÊÇÔËÐÐÓÚ·þÎñÆ ......