无规律自定义分段的分类汇总+交叉表处理

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

/*--原帖地址:http://community.csdn.net/Expert/topic/3845/3845290.xml?temp=.3689386--*/

--测试数据createtabletb(编号int,性质varchar(10),数量int,指标1decimal(10,1),指标2decimal)inserttbselect1,'00',10,1.1,10unionallselect2,'01',20,1.2,20unionallselect3,'00',30,1.5,10unionallselect4,'01',40,1.9,35unionallselect5,'00',40,1.2,20

/*--处理要求

要求得到下述结果:

a                     范围              性质(00)        性质(01)        -------------------------------------------------------------指标1              <1.0             .00           .00                         1.0-1.29       .63           .63                        1.3-1.59       .38           .38                        1.9-1.99       .00           .00                        >=2              .00           .00指标1平均值                       1.27          1.55指标2              <10             .00           .00                        10-31           1.00          1.00                        31-50           .00           .00                        >=50            .00           .00指标2平均值                       13.33         27.50数量合计:                         80.00         60.00------------------------------------------------------------------1 <script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
文章标签: 测试
个人分类: 数据库
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭