文章分组统计后的,在的到总行数,为什么有错???select count(*) from (select author,count(*) from articles group by author)

解决方案 »

  1.   

    select count(*) from (select author,count(*) from articles group by author) AS a
      

  2.   

    --直接这样也行
    select count(distinct author) from articles
      

  3.   

    这样写为什么错了?
    select count(*) from (select author,count(*) from articles group by author) AS a服务器: 消息 8155,级别 16,状态 2,行 1
    没有为第 2 列(属于 'a')指定列。
      

  4.   

    --select count(*) from (select author,count(*) from articles group by author) AS a
    select count(*) from (select author,cn = count(*) from articles group by author) AS a