Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎÊ´ð£º

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......

sql ÎÊÌâ - MS-SQL Server / »ù´¡Àà

ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......

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

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

Accessͨ¹ýSqlÓï¾ä´´½¨Êý¾Ý¿â - .NET¼¼Êõ / C#

ÔÚAccessµÄ²éѯÖÐÖ´ÐÐÏÂÃæµÄÓï¾ä,ÎÞЧ,ÌáʾÆÚ´ýselect ,updata ,...
CreateTble C=Answer N="»ØÌû±í"
(
  C=ID T="INTEGER" P=No M=No N="±àºÅ" Z=false,
  C=Ques ......

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

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

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