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
Ïà¹ØÎÊ´ð£º
ÇëÎʸßÊÖ2005µÄ±ê×¼°æÊÇ·ñ¿ÉÒÔÔ¶³ÌÁ¬½Ó£¬Èç¹û¿ÉÒÔ£¬Ó¦¸ÃÔõôÉèÖã¬ÎÒ°´ÕÕ Express°æµÄÉèÖÃÁË£¬²»ÐС£¡£
¿ÉÒÔ
¿ÉÒÔ
²»ÖªµÀÄãÏëÔõôԶ³ÌÁ´½Ó
Ö±½ÓÔÚ¿Í»§¶ËµÇ¼¡£¡£
°´ÕÕ5Â¥µÄ×öÁË È»ºóÔÚ¿Í»§¶ËдÁ¬½Ó× ......
ÏÖÔÚÐèÒªÔÚSQL ServerʵÏÖ¶¨Ê±±¨±íÊä³öµÄ¹¦ÄÜ£¬
ÀýÈçÔÚÿÌìµÄ12µãÉú³Éµ±ÌìµÄ±¨±í£¬²¢Êä³öµ½Excel»òÆäËü¸ñʽµÄÎļþÖС£
ÎÒµ÷²éÁËһϣ¬ËµSQL Server ±¨±í·þÎñÓÐÕâ¸ö¹¦ÄÜ£¬µ«ÊÇûÓùý±¨±í·þÎñ£¬²»ÖªÈçºÎʵÏÖ£¬Çë ......
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 ......
Êý¾Ý¿âij±í£¬Ï뽫ÆäÖÐf1,f2Á½¸ö×ֶεÄÄÚÈÝ·10±¶£¬Çë½ÌÈçºÎд·¨£¿
update tbl set f1= f1*10£¬f2= f2*10 where id=10451
ÕâÖÖд·¨»áÔì³Éplsql¿¨ËÀ
²»»á°É£¬ÄǸöid=10451 µÄÊý¾ÝÓжàÉÙ°¡~~~~
ÎÒ¹À¼ÆsqlÊDz» ......
ÎÒµÄÊý¾Ý¿âµÄ±íÊǶ¯Ì¬µÄ±í,ÔÚÌí¼ÓÊý¾ÝµÄʱºòÓÐÒ»¸ö×Ö¶ÎÊÇDATETIMEÊý¾ÝÀàÐ͵Ä,ÏÂÃæÊÇ´æ´¢¹ý³Ì
if exists (select * from sysobjects where name='proc_ADD_Order')
drop proc proc_ADD_Order
go
......