“评价”字段中的值为:好,不好我想获取字段为“评价”中“好”的统计个数输送给变量answer应该如何做到?ASP高手赐教#$这个语句的功能能够得到我想要的“好”的个数answer="select count(*) 表名 where 评价='好'"好像不行啊。
<%Set rsa= Server.CreateObject ("ADODB.RecordSet")sql = "select count(*) from 数据库表名 where 评价="好""rs.open sql, con,3,3 answer = rs(0)%>应该可以的!
<%Dim answer Set answer= conn.Execute("SELECT Count(id) FROM 表名 where 评价="好"") Response.Write answer(0) %>
sql = "select count(*) from [table] where 评价='好'"set rs = conn.Execute(sql)answer = rs(0)rs.closeset rs = nothing