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

SQL²éѯÏÔʾÎÊÌâ(2) - MS-SQL Server / »ù´¡Àà

ÓÐÒ»¸ö×Ö¶ÎA £¬ÀïÃæÊǾßÌåÊÇÊý×Ö£¬
ÎÒÏëÈÃËû²éѯÏÔʾʱ¼ÓÅÐ¶Ï ±ÈÈç £º0-100 ÏÔʾ³É£º1 £»101-200 ÏÔʾ³É£º2  
ÈçºÎʵÏÖ£¬²»Ê¤¸Ð¼¤£¡£¡£¡


ÒýÓÃ
ÓÐÒ»¸ö×Ö¶ÎA £¬ÀïÃæÊǾßÌåÊÇÊý×Ö£¬
ÎÒÏëÈÃËû²éѯÏÔʾʱ¼ÓÅÐ¶Ï ±ÈÈç £º0-100 ÏÔʾ³É£º1 £»101-200 ÏÔʾ³É£º2
ÈçºÎʵÏÖ£¬²»Ê¤¸Ð¼¤£¡£¡£¡

select case when col between 0 and 100 then 1 when col between 100 and 200 then 2 end from tb

SQL code:
select case when '0-100' then 1 else 0 end as'col1',
case when '101-200' then 2 else 0 end as 'col2'
from tb


SQL code:
select case when col between 0 and 100 then 1
when col between 100 and 200 then 2 end
from tb


select *,(select count(1) from tb where right(A,len(A) - charindex('-',A))<=right(t1.A,len(t1.A) - charindex('-',t1.A))) 
from tb t1 join tb t2 on right(t1.A,len(t1.A) - charindex('-',t1.A))+1 = left(t2.A,charindex ('-',t2.A) -1)



Ïà¹ØÎÊ´ð£º

ÇóÒ»sqlÓï¾ä - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......

¹ØÓÚSQLÓï¾äORµÄÎÊÌâ - Oracle / ¸ß¼¶¼¼Êõ

ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬
·½·¨1£º
°Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû'
......

ASPÒ³ÃæÎÞ·¨´ò¿ªÇóÖú£¡ - MS-SQL Server / »ù´¡Àà

¸÷λºÃ£¬ÎÒ¸Õ°ÑÒ»¸öASPÍøÕ¾ÉèÖúÃÁË£¬Ò²ÄÜÕý³£·ÃÎÊ¡£µ«ÊÇÔÚÎÒ±¾»úÉϲ»ÄÜ´ò¿ªadmin\login.asp,ËùÒÔÎÞ·¨ÊµÏÖºǫ́¹ÜÀí¡££¨´íÎóÌáʾÎÞ·¨ÕÒµ½ÍøÒ³£¬´úÂë404£¬ÎҵIJÙ×÷ϵͳÊÇwin2000 server)
µ«ÊÇÆæ¹ÖµÄÊÇÔÚ¾ÖÓòÍøµÄÆäËû» ......

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

A±í ÓÐÁ½¸ö×ֶΠ
  id ΨһÊý×ÖÓò
  InfoTxt text ÀàÐÍ
 ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×Ö¶Î Îı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa' 
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ