SELECT COUNT(LocationId) AS Expr1 FROM tblSuburbs, tblWouldBeDonors where tblSuburbs.SuburbId = tblWouldBeDonors.LocationId
不能包含非统计字段信息。否则,会出错误的。

解决方案 »

  1.   

    ykn(ykn)说的是对的。
    但是,如果你的意思是想求出SuburbName对应的LocationId有多少个的话,可以用group by来解决。
      

  2.   

    对对对,就是要那样的结果。
    可是这样改了以后还是不行,说表达式不匹配。
    还有,用group by 是不是
    SELECT COUNT(LocationId) AS Expr1 FROM tblSuburbs, tblWouldBeDonors where tblSuburbs.SuburbId = tblWouldBeDonors.LocationId group by 
    tblSuburbs.SuburbId?
      

  3.   

    group by tblSuburbs.SuburbId,tblWouldBeDonors.LocationId