select sum(total) from select count(*) as total from tvisted group by userid用这句话查询时总是说“在关键字 'select' 附近有语法错误。”不知道为什么

解决方案 »

  1.   

    select sum(total) from 
    (select count(*) as total from tvisted group by userid)a
      

  2.   

    select sum(total) as total from (select count(*) as total from tvisted group by userid) t
      

  3.   

    我晕,你不就想查:
    select count(*) from  tvisted 
    吗?
      

  4.   

    我晕,你不就想查:
    select count(*) from  tvisted 
    吗?当然不是啦,呵呵
      

  5.   

    select sum(total) as total from (select count(*) as total from tvisted group by userid) t这个和我原来犯了一样的错。