谁能帮我翻译下asp sql的意思啊,菜鸟非常感谢

来源:百度知道 编辑:UC知道 时间:2024/07/06 23:58:58
rs.open sql,conn,1,1
allrs=rs.recordcount
rs.close

sql="select * from score_info where 1=1 and course='"&k&"' "
sql=sql&" and score>=90 "
if trim(xi)<>"" then
sql=sql&"and xi='"&xi&"' "
end if
if trim(dui)<>"" then
sql=sql&"and dui='"&dui&"' "
end if

rs.open sql,conn,1,1
youxiu=rs.recordcount
rs.close

sql="select * from score_info where 1=1 and course='"&k&"' "
sql=sql&" and score>=60 "
if trim(xi)<>"" then
sql=sql&"and xi='"&xi&"' "
end if
if trim(dui)<>"" then
sql=sql&"and dui='"&dui&"' "
end if

rs.open sql,conn,1,1 '执行sql语句
allrs=rs.recordcount'将符合sql语句条件的记录总数赋值给变量allrs
rs.close'关闭数据库操作对象

sql="select * from score_info where 1=1 and course='"&k&"' "'定义sql语句 查询score_info表中条件为字段1的值为1 并且course字段的值为变量k(字符变量K)
sql=sql&" and score>=90 " '上面的sql后面的条件 字段score的值大于等于90 And 是逻辑与的意思
if trim(xi)<>"" then'如果去掉变量xi前后的空格后的值不为空 则执行下面的语句
sql=sql&"and xi='"&xi&"' "'同上一句sql
end if'结束IF条件分支选择语句
if trim(dui)<>"" then'同上一句if
sql=sql&"and dui='"&dui&"' "
end if

rs.open sql,conn,1,1 '执行sql语句
youxiu=rs.recordcount'将符合条件的记录总数赋值给变量yunxie
rs.close'关闭Rs对象

sql="select * from score_info where 1=1 and course='"&k&"' "
sql=sql&" and score