select
<%
dim id
id=request.QueryString("id")
dim conn
set conn=server.CreateObject("ADODB.connection")
dim strcon
strcon = "Provider = Microsoft.Jet.oledb.4.0; Data Source= "&server.mappath("bt.mdb")&";"
conn.open strcon
dim rs
set rs=server.CreateObject("ADODB.recordset")
dim strsql
strsql="Select tenhang,maloai,count(tenhang) as sl from hang where maloai='"&id&"' group by tenhang,maloai"
rs.open strsql,conn
%>
<table border=1>
<tr>
<td>Ten Hang</td>
<td>Ma loai</td>
<td>So luong</td>
</tr>
<%
do while not rs.EOF
%>
<tr>
<td><% response.Write(rs("tenhang")) %></td>
<td><% response.Write(rs("maloai"))%></td>
<td><% response.Write(rs("sl"))%></td>
</tr>
<%
rs.moveNext
loop
rs.close
conn.close
%>
</table>
Bạn đang đọc truyện trên: AzTruyen.Top