sql ×Ö·û´®´¦Àí - MS-SQL Server / Ó¦ÓÃʵÀý
ÓÐÒ»¸ö±íµÄ×Ö¶ÎFileName±£´æÊý¾ÝÊÇ:010101 »ò 100010 »ò 111100 111111 ´ú±í == >> abcdef create table a ( id int not null, FileName varchar(100) not null ) insert into a values(1,'010101') insert into a values(2,'100010 ') insert into a values(3,'111100') Æ©Èç:ÊäÈëÒ»¸ö FileNameµÄֵΪ 010101 --->>b;d;f Èç: select funs('010101') from a; /** b;d;f */ funsÕâ¸öº¯ÊýÒªÇó°ïæµÄ..лл
ÒªÇóдһ¸öº¯Êý ³¤¶ÈÊǹ̶¨µÄ²»£¿ SQL code: case when substing(FileName,1,1)=0 then '' else 'a' end +';'+ case when substing(FileName,2,1)=0 then '' else 'b' end +';'+ case when substing(FileName,3,1)=0 then '' else 'c' end +';'+ ......ÒýÓà SQL code case when substing(FileName,1,1)=0 then '' else 'a' end +';'+ case when substing(FileName,2,1)=0 then '' else 'b' end +';'+ case when substing(FileName,3,1)=0 then '' else 'c' end +';'+ ...¡¡ Õâ¸ö²»ÊÇÎÒÏëÒªµÄ.. ³¤¶È²»¹Ì¶¨µÄ.. ´Ó¡°010101¡± ת»»¡°b;d;f¡±£¬ËûÃǵĹØÏµÊÇʲô£¿Èç¹ûÒ»µã¹ØÏµ¶¼Ã»ÓУ¬ËüÊÇʲô³öÀ´µÄ£¬²»Ã÷°×£¿ ÊDz»ÊÇÕâ¸ö±í»¹ÓÐÆäËû×ֶΣ¿ ÊÇÓÐÆäËû±í... ÉÏÃæµÄÎÒÖ»ÊǾٸöÀý×Ó... SQL code Code highlighting produced by Actip
Ïà¹ØÎÊ´ð£º
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£ 2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ ) ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......
±íÊý¾Ý COL1 COL2 COL2 COL4 COL5 ---------------------------------------------------------------------------------------------- 2010-05-05 00:00 ......
A±í ÓÐÁ½¸ö×Ö¶Î id ΨһÊý×ÖÓò InfoTxt text ÀàÐÍ ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×Ö¶Î Îı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa' °´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......
ÎÒÓÐÒ»¸ö×Ö¶ÎÊÇ varchar(1) ÀàÐÍ£¬¶þ½øÖƱíʾҲ¾ÍÊÇ8λµÄ ¡®0000 0000¡¯ ±ÈÈçÕâ¸öʱºòÎÒÐèҪɸѡ³öÕâ¸ö×Ö¶ÎΪËùÓÐµÄ ¡®0000 0100¡¯µÄÐУ¬ÇëÎÊSQLÄÜʵÏÖÕâÑùµÄ¡°Î»¡±µÄɸѡÂ𣿠лл~~~ ÓÐλ²Ù×ݺ¯ÊýÂ𣿲»ÐоÍ× ......