如何获得记录集中某一数据的排名
我的数据库如上图:表名为Info,分别有id,title,rq,ps等字段,按ps从高向低排名形成一个记录集后,如何获得ID为14在记录集中的排名?请大家帮忙。
我的代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim pm
Dim pm_numRows
Set pm = Server.CreateObject("ADODB.Recordset")
pm.ActiveConnection = MM_conn_STRING
pm.Source = "SELECT id, ps, rq, title FROM Info ORDER BY ps DESC"
pm.CursorType = 0
pm.CursorLocation = 2
pm.LockType = 1
pm.Open()
pm_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
</body>
</html>
<%
pm.Close()
Set pm = Nothing
%>