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

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


Ïà¹ØÎÊ´ð£º

Çë½ÌSQLSERVERµÄÁ½¸öÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......

Çóһʱ¼ä±È½ÏµÄSQL Ö¸Áî - MS-SQL Server / »ù´¡Àà

±íÊý¾Ý
COL1 COL2 COL2 COL4 COL5
----------------------------------------------------------------------------------------------
2010-05-05 00:00 ......

C# SQL µÄUPDATETEXT ÎÊÌâ - .NET¼¼Êõ / C#

A±í ÓÐÁ½¸ö×ֶΠ
  id ΨһÊý×ÖÓò
  InfoTxt text ÀàÐÍ
 ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×Ö¶Î Îı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa' 
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......

SQLÄܽøÐжþ½øÖƵÄɸѡÂ𣿠- MS-SQL Server / »ù´¡Àà

ÎÒÓÐÒ»¸ö×Ö¶ÎÊÇ varchar(1) ÀàÐÍ£¬¶þ½øÖƱíʾҲ¾ÍÊÇ8λµÄ ¡®0000 0000¡¯
±ÈÈçÕâ¸öʱºòÎÒÐèҪɸѡ³öÕâ¸ö×Ö¶ÎΪËùÓÐµÄ ¡®0000 0100¡¯µÄÐУ¬ÇëÎÊSQLÄÜʵÏÖÕâÑùµÄ¡°Î»¡±µÄɸѡÂð£¿
лл~~~

ÓÐλ²Ù×ݺ¯ÊýÂ𣿲»ÐоÍ× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ