请教一条pl/sql语句
假设有这样的一个表:
id  
1   10
1   30
2   40
2   50
2   10
请问如何用pl/sql语句,得到下面的结果呢
id  
1   40
2   100谢谢~~~~~

解决方案 »

  1.   

    select id, sum() 
    from tab
    group by id
      

  2.   

    c      40
    d      50
    e      10
    f      15
    b      10
    我怎么才能查到下面的结果?(把name 相同的查出来)
    name  
    b      30
    b      10
      

  3.   

    name  
    a      10
    b      30
    c      40
    d      50
    b      10
    我怎么才能查到下面的结果?(把name 相同的查出来)
    name  
    b      30
    b      10
      

  4.   

    select id, sum() 
    from table_name
    group by id
      

  5.   

    select id,sum() from table_name group by idto shiyi54321:
    select a.name,a. from table1 a,table1 b  where a.name=b.name  group by b.name having count(*)>1
      

  6.   

    select id,sum() from table_name group by id