asp的这句话,怎么写,请指点

来源:百度知道 编辑:UC知道 时间:2024/09/23 19:01:51
我用select count(*) from table11111 where age=50 检索出了想要的记录数,我想让变量sum等于刚才检索出的count(*),请问应该怎么写?
比如:sum=rs("count(*)") ,这样我觉得应该不对,请问应该怎么写?

select count(*) as aa from table11111 where age=50
sum=rs("aa")

select count(*) as aa from table11111 where age=50
sum=rs("aa")
*代表查询字段。

count(*)是总的检索出的记录数只有一个数据,sum是要统计所有的数据的和

用sum=rs(0)