当前位置:首页
开发技术指南» 文章正文
    引言:

 ·送分 题 双系统启动    »显示摘要«
    摘要: 装了双操作系统,怎么把开机出现的选择项去掉。 超级兔子有这个功能。 自己怎么做设置呢?? ......
    摘要: 前台是delphi6,数据库是mssqlserver2000,数据有6000多条。5个表联合查询,用查询分析器查询需要2-3秒,用程序开始查询到显示结果集大约十几秒的时间,客户要求加快显示时间,有没有好的办法?谢谢! 查询格式为: select a.id, a.name, a....., b.name, c.class, d.teacher, e.student from a left j......


如何动态生成表结构

如何由  
  表1  
  office         procode       fact_qty  
  bj                   p1                   3  
  bj                   p2                   4  
  bj                   p3                   8  
  sh                   p1                   2  
  sh                   p2                   5  
  sh                   p3                   9  
   
  得到  
  表2  
  procode       bj       sh  
        p1           3         2  
        p2           4         5  
        p3           8         9  
   
  office   的内容会变化  
   
  表2可以动态生成吗  
   
  谢了

NO.1   作者: vivianfdlpw

create   table   A  
  (  
      office   varchar(10),  
      procode   varchar(10),  
      fact_qty   int  
  )  
  insert   A  
  select   bj,p1,3   union  
  select   bj,p2,4   union  
  select   bj,p3,8   union  
  select   sh,p1,2   union  
  select   sh,p2,5   union  
  select   sh,p3,9    
   
  --查询  
  declare   @sql   varchar(8000)  
  set   @sql=  
  select   @sql=@sql+,sum(case   when   office=+office+   then   fact_qty   else   0   end)   as   +office+  
  from   A   group   by   office  
  select   @sql=select   procode+@sql+   from   A   group   by   procode  
  exec(@sql)  
   
  --删除测试环境  
  drop   table   A  
   
  --结果  
  /*  
  procode         bj                     sh                      
  ----------   -----------   -----------    
  p1                   3.00                 2.00  
  p2                   4.00                 5.00  
  p3                   8.00                 9.00  
  */


    摘要: 从0改到1 从1 改到0,用asp应该怎么写这个阿? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE