获取随机记录
摘要:在开发过程中我们常常需要取得随机记录,通过比较觉得以下两种是通过验证的最可行的方法。mssql数据库去随机N条记录方法:%set rs=server.CreateObject("adodb.recordset")sql="select top 4 * from news order by newid()"rs.open sql,conn,1,1if not rs.eof thendo while not rs.eofresponse.Write rs("id")&"---"&rs("title")&"br"rs.movenextloopend ifrs.closeset rs=nothi
阅读全文
posted @ 2011-01-10 18:10
浙公网安备 33010602011771号