mysql concat,substringÓ÷¨
ÔÚ¹¤×÷ÖÐÅöµ½Ò»¸öMysql×ֶθüÐÂÎÊÌâ
ÔÚcustom±íÖÐÓÐÒ»¸ötariffurlµÄÖµÖÐÓÐÈçÏÂÇé¿ö£º
uploadfiles ariff2007031172720306698.jpgÒÔ¼°uploadfiles ariff2007031172720306690.jpg;uploadfiles ariff2007031172720306691.jpgÐÎʽ
Òª¸ü¸Ä³Éuploadfiles/tariff/200703/1172720306698.jpg¼° uploadfiles/tariff/200703/1172720306690.jpg;uploadfiles/tariff200703/1172720306691.jpg ÐÎʽ
¿ÉÒÔ×ÛºÏÀûÓÃsubstringº¯ÊýºÍcancatº¯ÊýÀ´ÊµÏÖ£¬²½ÖèÈçÏ£º
1¡¢ update custom set tariffurl=concat('uploadfiles/tariff/200703/',substring(tariffurl,24)) where tariffurl like 'uploadfiles ariff200703%'
2¡¢update custom set tariffurl=concat(substring(tariffurl,1,55),'/tariff/200703/',substring(tariffurl,68))
where tariffurl like 'uploadfiles/tariff/200703/%' and tariffurl like'%;uploadfiles %'
substring(filed,m):½ØÈ¡filed×ֶδӵÚm¸ö×Ö·û¿ªÊ¼µ½½áÊøµÄ×Ö·û´®£»
substring(filed,m,n):½ØÈ¡filed×ֶδӵÚm¸ö×Ö·û¿ªÊ¼µÄ³¤¶ÈΪnµÄ×Ö·û´®£»<-------MSSQL
cancat(string1,sting2,……):½«string1¡¢string2, ……×Ö·û´®Á¬½ÓÆðÀ´¡£
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://www.yayu.org/look.php?id=113
1£ºÔÚÖÕ¶ËÏ£ºmysql -V¡£
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
[shengting@login ~]$ mysql -V
mysql Ver 14.7 Distrib 4.1.10a, for redhat-linux-gnu (i686)
2£ºÔÚmysqlÖУºmysql> status;
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
mysql> status;
--------------
mysql ......
±¾ÎÄÀ´×Ô: ITÔËάר¼ÒÍø ×÷Õß: NetSeek ÈÕÆÚ: 2009-3-8 19:52 ÔĶÁ: 742 ÈË ´òÓ¡ ÊÕ²Ø DNS, Bind, DLZ, ÖÇÄÜ, MySQL ×÷Õß:NetSeek http://www.linuxtone.org
ÈÕÆÚ:2009-3-7 gmail:cnseek@gmail.com
ÍƼöÏÂÔØPDF°æ£¨·½±ã²éÔÄ):http://www.linuxtone.org/project/cdn/bind-dlz-view.pdf
¡¾Ìâ ¸Ù¡ ......
Real example:
/*************************by garcon1986*********************************************************/
<?php
// get the values from entreprise creation form
$secteur = $_POST['secteur'];
$nom = $_POST['nom_entreprise'];
$taille = $_POST['taille_entreprise'];
$concurrent = $_POST[' ......
http://book.51cto.com/art/200803/68118.htm
ÕªÒª£º¡¶ÉîÈëdz³öMySQL——Êý¾Ý¿â¿ª·¢¡¢ÓÅ»¯Óë¹ÜÀíά»¤¡·´ÓÊý¾Ý¿âµÄ»ù´¡¡¢¿ª·¢¡¢ÓÅ»¯¡¢¹ÜÀí4·½Ãæ¶ÔMySQL½øÐÐÁËÏêϸµÄ½éÉÜ£¬ÆäÖÐÿһ²¿·Ö¶¼¶ÀÁ¢³Éƪ£¬Ã¿Ò»ÆªÓÖ°üÀ¨¶à¸öÕ½ڡ£±¾ÊéÃæÏòʵÓã¬ÄÚÈݸ²¸Ç¹ã·º£¬½²½âÓÉdzÈëÉÊʺÏÓÚ¸÷¸ö²ã´ÎµÄ¶ÁÕß¡£
µÚ20ÕÂ ËøÎÊÌâ
ËøÊÇ ......
×öÏîĿʱÓÉÓÚÒµÎñÂß¼µÄÐèÒª£¬±ØÐë¶ÔÊý¾Ý±íµÄÒ»Ðлò¶àÐмÓÈëÐÐËø£¬¾Ù¸ö×î¼òµ¥µÄÀý×Ó£¬Í¼Êé½èÔÄϵͳ¡£¼ÙÉè id=1 µÄÕâ±¾Êé¿â´æΪ 1 £¬µ«ÊÇÓÐ 2 ¸öÈËͬʱÀ´½èÕâ±¾Ê飬´Ë´¦µÄÂ߼Ϊ :
Select restnum from book where id =1 ;
-- Èç¹û restnum ´óÓÚ 0 £¬Ö´ÐÐ update
Update boo ......