璇烽夋嫨 杩涘叆鎵嬫満鐗 | 缁х画璁块棶鐢佃剳鐗

灏忚眴缃

 鎵惧洖瀵嗙爜
 绔嬪嵆娉ㄥ唽
鎼滅储

SQL甯哥敤璇彞 鏇挎崲璇彞 鎵归噺淇敼銆佸鍔犮佸垹闄ゅ瓧娈靛唴瀹

[澶嶅埗閾炬帴]
鍙戣〃浜 2019-4-25 23:04:46 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
sql鏇挎崲璇彞锛岀敤璇ュ懡浠ゅ彲浠ユ暣鎵规浛鎹㈡煇瀛楁鐨勫唴瀹癸紝涔熷彲浠ユ壒閲忓湪鍘熷瓧娈靛唴瀹逛笂鍔犱笂鎴栧幓鎺夊瓧绗︺
鍛戒护鎬昏В锛歶pdate 琛ㄧ殑鍚嶇О set 姝よ〃瑕佹浛鎹㈢殑瀛楁鍚=REPLACE(姝よ〃瑕佹浛鎹㈢殑瀛楁鍚, '鍘熸潵鍐呭', '鏂板唴瀹')
濡 UPDATE Whir_ProductRelese SET ReleseName=REPLACE(ReleseName,'aa','bb')
涓句緥璇存槑锛
1锛夋妸backupfile琛ㄩ噷url鐨勫瓧娈靛唴瀹归噷涓篴a鐨勫瓧绗﹀叏閮ㄦ敼涓篵b銆
銆銆update backupfile set url=REPLACE(url,'aaa','bbb)
2锛夋牴鎹潯浠跺鍔犲瓧娈电殑鍐呭锛屽鎶奻ile_number=1鐨勮褰曠殑logical_name瀛楁鐨勫唴瀹瑰墠闈㈠姞涓妕mp锛屽悗闈㈠姞涓奺nd銆
銆銆update backupfile set logical_name=REPLACE(logical_name,logical_name,'tmp'+logical_name+' end ') where file_number=1
3锛夋牴鎹潯浠跺幓鎺夋寚瀹氳褰曠殑鍓嶉潰2涓瓧绗︺
銆銆update backupfile set logical_name=REPLACE(logical_name,logical_name,SUBSTRING(logical_name,3,len(logical_name)-2)) where file_number=1
4锛夋牴鎹潯浠跺幓鎺夋寚瀹氳褰曠殑鍚庨潰4涓瓧绗︺
銆銆update backupfile set logical_name=REPLACE(logical_name,logical_name,SUBSTRING(logical_name,1,len(logical_name)-4)) where file_number=2
濡傛湁涓嶆竻妤氱殑鍙互鍏堢敤select璇彞楠岃瘉鏄惁杈炬垚鑷繁鎯宠鐨勬晥鏋滃啀杩涜鏇挎崲锛
SELECT   REPLACE(鏇挎崲瀛楁,'鍘熷唴瀹','鏂板唴瀹') from 琛ㄥ悕;  
update 琛ㄥ悕 set 鏇挎崲瀛楁=(REPLACE(鏇挎崲瀛楁,'鍘熷唴瀹','鏂板唴瀹'))
5)   鎵归噺鏂板鏁版嵁锛屾妸A琛ㄦ暟鎹壒閲忔煡鍑哄苟娣诲姞鍒癆琛ㄤ腑
      insert into [dbo].[T_Channel_banklist](C_ID,Name,State)  (select C_ID,Name,1 from [T_Channel_banklist] where C_id=1101)
鏌ヨ涓婁竴鏉′笅涓鏉
--濡:(姝e簭)褰撳墠MenuID=2,閭d箞涓婁竴鏉″垯鏄1(ORDER BY MenuID ASC),涓嬩竴鏉℃槸3(ORDER BY MenuID DESC)
--姝e簭锛1,2,3锛  
--涓婁竴鏉  
SELECT TOP 1 * FROM tbl_SoleHome_Menu WHERE MenuID>2 ORDER BY MenuID ASC  
--褰撳墠  
SELECT TOP 1 * FROM dbo.tbl_SoleHome_Menu WHERE MenuID=2  
--涓嬩竴鏉  
SELECT TOP 1 * FROM tbl_SoleHome_Menu WHERE MenuID<2 ORDER BY MenuID DESC  
--鍊掑簭锛3,2,1锛  
--涓婁竴鏉  
SELECT TOP 1 * FROM tbl_SoleHome_Menu WHERE MenuID<2 ORDER BY MenuID DESC  
--褰撳墠  
SELECT TOP 1 * FROM dbo.tbl_SoleHome_Menu WHERE MenuID=2  
--涓嬩竴鏉  
SELECT TOP 1 * FROM tbl_SoleHome_Menu WHERE MenuID>2 ORDER BY MenuID ASC  

鍥炲

浣跨敤閬撳叿 涓炬姤

鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽

鏈増绉垎瑙勫垯

QQ|Archiver|鎵嬫満鐗|灏忛粦灞|灏忚眴缃 ( 妗侷CP澶10003008鍙-3 )

GMT+8, 2019-6-19 17:00 , Processed in 0.205858 second(s), 33 queries .

广西网警虚拟岗亭
蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃