Ch15-03-07.aspx SELECT表达式的IN子集查询
Sub Page_Load(Obj As Object, e As EventArgs)
Dim DSN As String, tSQL As String
' 设置使用联机字符串
DSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/ASP/Chap14/ASP.NET网页数据库.mdb") & ";"
' 设置SQL语句
tSQL = "SELECT * FROM UserDatas WHERE UserName IN " & _
"( SELECT TOP 2 UserName FROM UserDatas " & _
" GROUP BY UserName ORDER BY UserName DESC)"
ShowResultSet(DSN, tSQL)
End Sub