1、是不是要
select ... from info 
union all 
select ... from bak_info
?2、
select top 10 * from info where c='一班'

解决方案 »

  1.   

    这里需要统计字段B的和,就是99+88+77+66+....
    可不可以在Sql语句中查询到结果,因为用一个循环在页面上累加就必须显示全部,而我的页面没页只有10条,远远不够的
      

  2.   

    2、参考http://community.csdn.net/Expert/topic/3049/3049957.xml?temp=.9828607
    j9988写的存储过程
      

  3.   

    是不是用sum函数,不知道该如何写,大家帮帮我
      

  4.   

    1、
    select ... from info 
    union all 
    select ... from bak_info
    2、
    select c,sum(b) as sum from info group by c
      

  5.   

    to. pressman(行者)
    可以是可以,可是如果不是select c,是select *
    难道要group by c,d,e,f,g,....
      

  6.   


    除了用SUM我也不知道再能怎么做了,
      

  7.   

    当然你可以把select c,sum(b) as sum from info group by c和别的表JOIN呀也可以直接在ASP里用RS:
    Set rs= Server.CreateObject("ADODB.Recordset")
    SQLstr = "select c,sum(b) as sum from info group by c"
    rs.Open SQLstr,conn,1,3