sql×Ö·û´®Ìæ»»(ÓеãÌôÕ½···)
±ÈÈç ÓÐÒ»×Ö¶ÎΪ£º
Num
6111
6201
6520
65121
60087
46300
ÎÒÏë°Ñ6¿ªÍ·µÄÈ«¶¼Ìæ»»³É5¿ªÍ·
×¢ÒâÕâÊDZíÀïµÄÊý¾Ý£¬ÎÒÏëÓÃSQLÓï¾äʵÏÖÌæ»»
SQL code:
update tb set
num = stuff(num,1,1,'5')
where num like '5%'
SQL code:
update tb
set num=stuff(ltrim(num),1,1,'5')
where ltrim(num) like '6%'
SQL code:
-------------------------------------
-- Author : liangCK Áº°®À¼
-- Comment: СÁº °® À¼¶ù
-- Date : 2009-10-12 19:38:25
-------------------------------------
--> Éú³É²âÊÔÊý¾Ý: @tb
DECLARE @tb TABLE (Num int)
INSERT INTO @tb
SELECT 6111 UNION ALL
SELECT 6201 UNION ALL
SELECT 6520 UNION ALL
SELECT 65121 UNION ALL
SELECT 60087 UNION ALL
SELECT 46300
--SQL²éѯÈçÏÂ:
update @tb set
num = stuff(num,1,1,'5')
where num like '6%'
SELECT * from @tb
/*
Num
-----------
5111
5201
5520
55121
50087
46300
(6 ÐÐÊÜÓ°Ïì)
*/
Ò»ÑùµÄÊÖÎó.½«WHEREµÄ5¸ÄΪ6
»òÕßSQL code:
updat
Ïà¹ØÎÊ´ð£º
....½Óµ½Ò»¸öС³ÌÐò..¹¤×÷ÔÀ´´ó¸ÅÊÇÕâÑùµÄ...ǰ̨ÊÇWEB·þÎñÆ÷.¼Ü¹¹¾ÍÊÇASP+SQL..ǰ̨ÓÉASPÏòSQLÌí¼Ó·þÎñÀà±ð(±íµ¥).È»ºóÓÖºǫ́³ÌÐò¶ÁÈ¡±íµ¥..Ҫʵʱ¶ÁÈ¡..È»ºóÏÔʾÔÚ·þÎñÆ÷ÉÏÃæ..´ÓÀíÂÛÉÏÃæÄÜÐÐͨ²»?Èç¹û¿ÉÒÔ..ºǫ́ ......
ÓÐÒ»¸ö±íAA
name tj
1 a
1 b
1 c
2 a
2 d
3 b
ÒªÇóµ±tj×ֶεÄÖµ¼ÈµÈÓÚaÓÖµÈÓÚcʱ£¨tj = ¡®a¡ ......
µã»÷¡°·þÎñ¹ÜÀíÆ÷¡±£¬µã»÷¡°¿ªÊ¼/¼ÌÐø¡±£¬×ÜÊÇÏÔʾ¡°ÓÉÓڵǼʧ°Ü¶øÆô¶¯·þÎñ¡±£¬È»ºóÔٴγö´í£¬²»Äܹ»½øÈ룬Ҳ²»Äܹ»²é¿´ÊôÐÔ£¬ÇëÎÊ´ó¼Ò¸ÃÔõô°ì£¿
ÎÒÊDzſªÊ¼Ñ§Ï°Êý¾Ý¿â£¬ÇëÎÊ´ó¼ÒÓÐûÓÐʲôºÃһЩµÄ½¨Òé»òÕ ......
sqlÓï¾ä£º
select loan_plan_id,l_collect_plan.loan_id,l_collect_detail.collect_isfinished from l_collect_plan
left join l_collect_detail on l_collect_plan.return_times=l_collect_detail.collect_vo ......
²éѯ½á¹û¼¯£º
ps online totle
a 0 10
b 1 11
c 5 8
ÏëÏÔʾ³ÉÕâÑù ......