----用sql语句写查询统计某一列个数 select count(colname) from tb ---就这个意思吧 ?
select count(列名) from 表
友情接分... :) select count(列名) from 表
如果不要重复项:select count(distinct(列名)) from 表名 。 呀,终于回答了一个问题。呵呵
再请各位帮忙: rs.Open "select id,count(neirong.id) as b from neirong where title='" & .TextMatrix(.Row, 4) & "'", cn If Not rs.BOF Then Do Until rs.EOF For A = 1 To rs("b") AA(A) = rs("id") Next Loop rs.MoveNext End If rs.Close 报错: 列'neirong,id'在选择列表中无效,因为该列未包含在聚合函数中,并且没有GROUP BY子句
select count(colname) from tb
---就这个意思吧 ?
select count(列名) from 表
呀,终于回答了一个问题。呵呵
rs.Open "select id,count(neirong.id) as b from neirong where title='" & .TextMatrix(.Row, 4) & "'", cn
If Not rs.BOF Then
Do Until rs.EOF
For A = 1 To rs("b")
AA(A) = rs("id")
Next
Loop
rs.MoveNext
End If
rs.Close
报错:
列'neirong,id'在选择列表中无效,因为该列未包含在聚合函数中,并且没有GROUP BY子句
接分~~~~~~~`
group by 列名1