select count(name) from table where 1<2 group by name

解决方案 »

  1.   

    下表:id  name
    1    A
    2    C
    3    B
    4    A
    5    C
    6    A我是想把字段值是A的相加,然后输出A的和
    谢谢
      

  2.   

    select sum(id) from table where 1 group by name
      

  3.   

    TO:zalvsa(水米)怎样把A的和,B的和,C的和利用一个SQL语句都给计算出来啊,谢谢
      

  4.   

    $sql = "select count(name) from table where 1<2 group by name";
    $quy = mysql_query($sql);
    while( $value = mysql_fetch_array($quy) ){
       echo $value[0]."<br>";
    }