本帖最后由 love_u_qt 于 2012-07-19 22:50:18 编辑

解决方案 »

  1.   

    select name, sex, count(1) from test 
    group by name,sex;
      

  2.   

    不是,你的SQL语句不是标准的SQL语句,只不过MYSQL没有报错select name, sex, count(1) from test group by name, sex;orselect age, count(1) from test group by age;
      

  3.   

    书上说的是SQL标准,而对于不同的数据库都可能与SQL标准有一点出入,或者说是扩展。
    这就是理论和实践,研究和生产的区别吧。
      

  4.   

    select name, sex, count(1) from test group by age;这句话虽然语法对  但是完全不符合任何理解select name, sex, count(1) from test group by name,sex; 这样才对
      

  5.   

    MYSQL 对标准语法进行了扩充,允许使用这个 group by, 不在GROUP BY中的字段则由MYSQL自行选取。