Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL ×Ö·û´®²ð·Ö

       ÓÐÕâÑùÒ»¸ö×Ö·û´®(ÖÐ,¹ú,ÖÐ,ÈËÃñ,¹ú,ÏÖ´ú¹¤Òµ»¯½ø³Ì,¹ú)
´¦Àí¹ýÖ®ºó±ä³É(ÖÐ,¹ú,ÈËÃñ,ÏÖ´ú¹¤Òµ»¯½ø³Ì)
 
        ÒÔÏÂÊÇÎҵķ½·¨,ÓÐʲô²»¶ÔµÄµØ·½»¹Çë¸÷λָµã
 ------------------ɾ³ýÖظ´µÄ×Ö·û
 declare
@v1 nvarchar
(100)
declare
@v2 nvarchar
(100)
declare
@v3 nvarchar
(100)
declare 
@split nvarchar
(100)
--N',,,,,ÖÐ,¹ú,ÖÐ,ÈËÃñ,,,,,¹ú,ÏÖ´ú¹¤Òµ»¯½ø³Ì,¹ú,,,'
set
@v1=N',  ,,     ,,ÖÐ,¹ú,ÖÐ,ÈËÃñ,  ,, ,    ,¹ú,ÏÖ´ú¹¤Òµ»¯½ø³Ì,¹ú,  ,,'
set
@v3=''
set
@split=','
/*
   @v1 :´æ´¢ÁÙʱ×Ö·û´®
   @v2 :»ñÈ¡Á½¸ö·Ö¸ô·ûÖеÄ×Ö·û´®
   @v3 :´æ´¢×îºóûÓÐÖظ´µÄ×Ö·û´®  
*/
if
left(@v1,1)<>@split
   set
@v1=@split+@v1
if
right(@v1,1)<>@split
   set
@v1=@v1+@split
while
len(@v1)>len(@split)*2
      begin
          set
@v2=substring
(@v1,len( @split),charindex
( @split,@v1,len
( @split)+1))
         if
len(@v2)>len
(@split)*2
            begin
              set
@v2=right
(@v2,len(@v2)-1);
              if
ltrim
(rtrim
(@v2))<>@split                
                 set
@v3=@v3+ltrim
(rtrim
(@v2));
              set
@v1= replace
(@v1,@v2,'')
            end
         else
--Èç¹ûÓÐÁ¬ÐøµÄ·Ö¸î·û,ɾ


Ïà¹ØÎĵµ£º

SQLÖеÄIF ELSE£¨CASEÓï¾äµÄʹÓã©

----start
    ´ó¼Ò¶ÔIF ELSEÓï¾ä¿ÉÄܶ¼ºÜÊìϤ£¬ËüÊÇÓÃÀ´¶Ô¹ý³Ì½øÐпØÖƵġ£ÔÚSQLµÄÊÀ½çÖÐCASEÓï¾äÓï¾äÓÐÀàËƵÄЧ¹û¡£ÏÂÃæ¼òµ¥µÄ½éÉÜCASEÓï¾äµÄÓ÷¨¡£¿¼ÂÇÏÂÃæµÄÇé¿ö£¬¼ÙÉèÓиöuser±í£¬¶¨ÒåÈçÏ£º
CREATE TABLE USER
(
NAME VARCHAR(20) NOT NULL,---ÐÕÃû
SEX INTEGER,---ÐÔ±ð£¨1¡¢ÄÐ 2¡¢Å®£©
BIRTHDA ......

SQL SERVER 2005Á·Ï°¼¯1

ÈëÃÅƪ
//////////////////////////////////////////// ­
%  : ±íʾ0~n¸öÈÎÒâ×Ö·û ­
_  : ±íʾµ¥¸öÈÎÒâ×Ö·û ­
[] :±íʾÔÚÀ¨ºÅÀïÁгöµÄÈÎÒâ×Ö·û ­
[^]:±íʾÈÎÒâ¸öûÓÐÔÚÀ¨ºÅÖÐÁгöµÄ×Ö·û ­
***********************­
ϵͳÊý¾Ý¿â­
MASTERÊý¾Ý¿â:­
   ......

¶¨Ê±ÖØÆôSQL ServerºÍTomcat

¶¨Ê±ÖØÆôSQL ServerºÍTomcat
[http://hi.baidu.com/personnel/blog/item/020d5edf020a281248540306.html]
¶¨Ê±ÖØÆôSQL ServerºÍTomcat
2007-06-07 08:23
ÒÔǰûÓÐ×Ô¼º¹ÜÀí·þÎñÆ÷»¹²»ÖªµÀ£¬SQL Server·þÎñÆ÷µÄÄÚ´æËæ×ÅÔËÐеÄʱ¼äÔö³¤¶ø²»¶ÏÔö³¤¡£
ÓÃÁËÒ»Á½ÌìÖ®ºó·¢ÏÖ½ø³ÌÖеÄSQL ServerÒѾ­Õ¼ÓÃÁ˽ü1.3GµÄÄڴ棬ÄÚ´æÒ»¹ ......

Ìá¸ßSQLÖ´ÐÐЧÂʵļ¸µã½¨Òé

from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í£¬driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£
 
¡¡¡¡Ìá¸ßSQLÖ´ÐÐЧÂʵļ¸µã½¨Òé:
¡¡¡¡¡ô¾¡Á¿²»ÒªÔÚwhereÖаüº¬×Ó²éѯ;
¡¡¡¡¹ØÓÚʱ¼äµÄ²éѯ£¬¾¡Á¿²»ÒªÐ´³É£ºwhere to_char(dif_date,'yyyy-mm-dd')=to_char('2007-07-01',' ......

SQLÓ¦ÓÃÈÕÖ¾

UPDATe [Sale_Goods]  SET [Catalog33_ID] = [Catalog].[ID]
from  [Sale_Goods]
LEFT OUTER JOIN [chdy222] ON [Sale_Goods].[Code] = [chdy222].[ID]
LEFT OUTER JOIN [Catalog] ON [chdy222].[ufidaname] = [Catalog].[Name] and [Catalog].[Type]=33
WHERE [Catalog].[ID] IS NOT NULL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ