·½·¨Ò»£º½¨Ò»¸öÆ´Òô±í 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
×î½ü¹«Ë¾ÓиöÍøÕ¾ÒªÏÈÅжϷþÎñÆ÷ÉϵÄÍøÒ³ÊÇ·ñ¿ÉÓã¬È»ºóÔÚ°ÑÖµÌá½»µ½Õâ¸öÍøÒ³ÉÏ¡£Ê¹ÓÃphpÀ´¼ì²âÍøÒ³ÊÇ·ñ¿ÉÓã¬Ã»Ôõô½Ó´¥¹ýphp£¬¸ãÁËÁ½Ì죬»ù±¾ÉÏÊÇ¿ÉÒÔ¼ì²âÁË¡£ÏÖ°Ñ´úÂëÌùÉÏ£º
<?php
//
$url = "http://blog.csdn.net/xuezhongsong/archive/2009/09/17/4561488.aspx";
$ ......
ÔÎÄÄÚÈÝûÓб仯£¬ÔÚ¹«Ë¾¿ìÏû»¯ÁËÁ½¸öϵͳÁË£¬ËùÒÔ´òËã×Ô¼ºÐ´Ò»¸ö¹¦ÄÜ»¹¿ÉÒԵĸöÈËϵͳ£¬ÎÒÖªµÀÍøÉϺܶ࣬ÎÒÒ²ÊÕ¼¯Á˺ü¸¸ö£¬µ«ÊÇÏë¿´¿´×Ô¼ºÄܲ»ÄÜ×ö³öÀ´£¬ºÃºÃ¼ÓÓÍ°É£¬ÔڳﱸµÄ¹ý³ÌÖÐÓöµ½ÁËÓʼþÕâÑùµÄÎÊÌ⣬ËùÒÔ»¨Á˵ãʱ¼äÑо¿ÁËÒ»·¬£¬ÍøÉÏÕÒµ½µÄºÃÄÚÈÝ£¬ÄóöÀ´·ÖÏíÒ»ÏÂ
ÒýÓÃÍøÖ·£ºhttp://www.china-askpro.com/msg36/qa ......
´óÈýÏÂѧÆÚ£¬ÎÒ½Ó´¥µ½ÁËPHP£¬Ñ§ÁËÒ»µã»ù±¾µÄÓï·¨£¬ÒòΪ¸úCµÄÓï·¨ºÜÏñ£¬ËùÒÔѧÆðÀ´ºÜÊ¡Á¦¡£½¥½¥µØÎÒϲ»¶ÉÏÁËPHPÕâÃÅÓïÑÔ£¬ÒòΪÓÃËü¿ÉÒÔ×öÍøÕ¾£¬µ½ÁË´óËÄÎÒ±ã¸ü¼ÓÉîÈëµØѧPHPÁË£¬Ñ§Ï°ÓÃPHP×ö¶«Î÷³ÉÁËÎÒÉú»îÖеÄÒ»²¿·Ö...............
PHPÊÇÔËÐÐÓÚ·þÎñÆ ......