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
Ïà¹ØÎÊ´ð£º
±¾ÈËc#ÐÂÊÖ ¿ÉÊÇÒªÇóÒªÓÃc# £¬sql2000¿ª·¢c/sµÄ¹¤×÷Á÷£¬Ò»Í·ÎíË®£¬Çë´ó¼Ò°ïæ°ï棬¸øµã˼·£¬ËµµÄÔ¼¾ßÌåÔ½ºÃ£¬ÎÒÒ²ºÃÍùÄǸö·½Ãæȥѧϰ
http://www.hxzi.com/view/61402.html
B/S°æµÄ£¬»ù±¾Ë¼ÏëÓ¦¸Ã²î²»¶àµÄ¡£¡£ ......
×ÜÊý±í
×ֶΠnum,freq
numÊÇËùÊôÆÚµÄ×ÜÊý£¬freqÊǼǼ¸ÃÊýÖµËùÊôÄÄÒ»ÆÚµÄ
ÇøÓò±í
×ֶΠarea_name,tot,freq
ÇøÓòÃû³Æ£¬¸ÃÇøÓòµÄ×ÜÊý£¬ËùÊôÆÚ
Á½ÕÅ±í¿¿freq¹ØÁª£¬ÇÒ²»ÊÇ×ÔÔö×ֶΣ¬²»ÊÇÖ ......
INSERT INTO StudAchieve(studID,studName)
VALUES('2','abc'),('2','bcd'),('2','cde')
Æ´ÁË°ëÌìÒ²²»¶Ô£¬¼°°¡ ¡£¡£¡£¡£
SQL c ......
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
ÏëÏÔʾ³ÉÕâÑù ......