select 'aa',sum(score) from a;

解决方案 »

  1.   

    select title,sum(score) from a where title = 'aa'
      

  2.   

    select title,sum(score) from e_bill where title ='aa'
     group by i_ship_id
      

  3.   

    select title,sum(score) from e_bill where title ='aa'
     group by title
      

  4.   

    可能我描述有误,
    表A结构
     id  title   score
     1    aa       1
     2    bb       2
     3    cc       3我知道的条件是知道id,我要得到的结果是:
    title  score
     aa      6
    请问怎样用一句SQL语句实现。
      

  5.   

    select title,sum(score) score from a where id='1' group by title
      

  6.   

    表A结构
     Aid  Bid  title   ascore
     1     2     aa      1
     2     1     bb      2
     3     1     cc      3表B结构
     id  bscore
      1    12
      2    18我知道的条件是知道表B的id,我要得到的结果是:
     bscore  score
       12      5
    请问怎样用一句SQL语句实现。
      

  7.   

    表B的id未确定
    如:
     bscore  score  id
       12      5    1
       18      1    2
    的SQL语句:
    select bscore,sum(ascore) score from A,B where B.id=A.Bid;
    知道表B的id的SQL语句:
    select bscore,sum(ascore) score from A,B where B.id=A.Bid and B.id=传进来的值;
      

  8.   

    select t1.title,sum(t2.sex) from a t2 left  join a t1 on t1.id=1 group by t1.id;
      

  9.   

    select t1.title,sum(t2.sex) from a t2 left  join a t1 on t1.id=1 group by t1.title;