方式 次数 金额合计


表中的方式列分别为,现金1\现金2\现金3,下表得出`现金1:1次!现金2:2次!现金3:1次 金额````~~~``
姓名  方式    金额
A     现金1   100
B     现金2    50
B     现金2    10
C     现金3   200

问在ORACLE中如何统计,现金1 \现金2\现金3```的次数`~!

解决方案 »

  1.   

    select 方式,count(1)  
      from table
    group by 方式
      

  2.   

    金额也要统计的话,这样写.select 方式,count(1),sum(金额) 
      from table
    group by 方式
      

  3.   

    oracle 中```count,sum不能这样写吧`?~?????
      

  4.   

    select 方式1||':'||count(方式),sum(金额)
     from table
    group by 方式
      

  5.   


    select count(姓名),方式
    from table_name
    group by 姓名,方式
      

  6.   

    三楼的不行```不可以,count,sum一起这样用`!