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
Ïà¹ØÎÊ´ð£º
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
´ó¼ÒºÃ£¬ÇëÎÊÔÚ±íMÖÐÓÐ×ֶΣºa b c d e
ÎÒÏë²é³öÆäÖÐÂú×ãÏÂÃæÈÎÒâÒ»ÏîµÄÊý¾Ý£¬1.×Ö¶Îa µÄÖµ²»ÊÇ ¡®Êé»ò±Ê»ò±¾¡¯ÖÐÈÎÒ»£¬2.aΪÊéµÄʱºò×Ö¶Îb,cÊÇ¿Õ;3.µ±aֵΪ±ÊµÄʱºòdÊÇ¿Õ;4.µ±aΪ±¾µÄʱºòb,d,e¶¼ÊÇ¿Õ;5.È ......
ÇëÎʸßÊÖ2005µÄ±ê×¼°æÊÇ·ñ¿ÉÒÔÔ¶³ÌÁ¬½Ó£¬Èç¹û¿ÉÒÔ£¬Ó¦¸ÃÔõôÉèÖã¬ÎÒ°´ÕÕ Express°æµÄÉèÖÃÁË£¬²»ÐС£¡£
¿ÉÒÔ
¿ÉÒÔ
²»ÖªµÀÄãÏëÔõôԶ³ÌÁ´½Ó
Ö±½ÓÔÚ¿Í»§¶ËµÇ¼¡£¡£
°´ÕÕ5Â¥µÄ×öÁË È»ºóÔÚ¿Í»§¶ËдÁ¬½Ó× ......
linq to sqlÀïÔõÑùʹËüÔÚ²åÈëÊý¾Ýʱ×Ô¶¯½Ø¶Ï¹ý³¤µÄ×Ö·û´®¶ø²»ÊÇÅ׳ö´íÎó
¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£ÎÒͨ³£¶¼ÊÇÌύʱ¾Í¼ì²éËûÔÚ³¤¶È¡£¡£¡£
²»ÊÇ£¬ÏÖÔÚÊÇÏîÄ¿×öÍêÁË£¬ºÜ¶àÄ£¿é²åÈëÊý¾Ýʱ¶¼³öÏÖÕâÑùµÄÎÊÌâ¡£ÒÔǰÓÃsqlpa ......
INSERT INTO StudAchieve(studID,studName)
VALUES('2','abc'),('2','bcd'),('2','cde')
Æ´Á˰ëÌìÒ²²»¶Ô£¬¼°°¡ ¡£¡£¡£¡£
SQL c ......