SQLÊý¾Ý²éѯÅÅÐò - .NET¼¼Êõ / ASP.NET
±íÃû lshg ×Ö¶ÎÃûstate ÏÂÃæÊÇÊÇÊý¾Ý
13.58%
9.88%
29.82%
7.86%
ʧ°Ü
27.55%
9.27%
4.93%
16.67%
22.85%
16.56%
2.44%
5.80%
16.80%
14.14%
8.37%
9.38%
13.96
24.21%
10.75%
Ôõô¸øËû½øÐÐÖØ´óµ½ÏÂÅÅÐò
¸ø×Ô¼º¶¥¸öÏÈ
select * from lshg order by state desc
UP
²»ÐÐ ÀïÃæµÄÊý¾ÝÊÇvarcharÀàÐ͵Ä
Â¥ÉÏÕý½â
ÐÞ¸ÄÄãµÄ±í¶¨Ò壬
Õâ·ÖÃ÷ÊǸöÓв¡µÄ±íÉè¼Æ£¡£¡
ÕæµÄûÓбðµÄ°ì·¨Âð
ÕæµÄûÓбðµÄ°ì·¨Âð
Äã¿ÉÒÔн¨Ò»¸öÁÙʱ±í¡£¡£´´½¨Ò»¸öINTµÄ×ֶΡ£¡£°ÑÄãstateÀïÃæµÄÊý¾ÝµÄ°Ù·ÖºÅÇ°ÃæµÄÒ»ÌõÌõ²åÈëµ½ÁÙʱ±íÀïÃæ¡£¡£ÔÙ¸ù¾ÝÁÙʱ±íµÄÊý¾Ýorderby
create table #Temp (aaa nvarchar(50))
insert into #Temp
select '13.58%'
union
select '9.88%'
union
select '29.82%'
union
select '7.86%'
union
select N'ʧ°Ü'
union
select '27.55%'
select * from #Temp
order by case aaa when N'ʧ°Ü' then 1000 else convert(float,substring(aaa,1,len(aaa)-1)) end
SQL code:
select *,substring(state,1,len(state)-1) from a
order by cast(substring(state,1,len(state)-1) as decimal) desc
SQ
Ïà¹ØÎÊ´ð£º
Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......
ÕâÀïÏëÁ˽âÏ£¬¹ØÓÚSQL ServerÖзÖÒ³ºÍOracleÖзÖÒ³£»
ƽ³£Ð´Ó¦ÓóÌÐòµÄʱºò£¬±ÈÈçÓõÄÓïÑÔÊÇJava£¬ÓиöÁбíÒ³Ã棬ÐèÒª¶ÔÊý¾Ý·ÖÒ³ÏÔʾ£»
ÕâÀïÒª·ÖÒ³ÄѵÀ²»ÐèÒª½èÖúJava£¬¶øÖ±½ÓsqlÄÜÖªµÀ·ÖÒ³Âð£¬ÆðÂëÒ²Òª´«¸öÒ³Âë½ ......
¸÷λºÃ£¬ÎÒ¸Õ°ÑÒ»¸öASPÍøÕ¾ÉèÖúÃÁË£¬Ò²ÄÜÕý³£·ÃÎÊ¡£µ«ÊÇÔÚÎÒ±¾»úÉϲ»ÄÜ´ò¿ªadmin\login.asp,ËùÒÔÎÞ·¨ÊµÏÖºǫ́¹ÜÀí¡££¨´íÎóÌáʾÎÞ·¨ÕÒµ½ÍøÒ³£¬´úÂë404£¬ÎҵIJÙ×÷ϵͳÊÇwin2000 server)
µ«ÊÇÆæ¹ÖµÄÊÇÔÚ¾ÖÓòÍøµÄÆäËû» ......