connection 你就自己写吧
sql="select department from other group by department"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,3
depts=""
do while not rs.eof
depts=depts&","&rs("department")
rs.movenext
loop
for each dept in split(depts,",")
sql1="select type,count(type) as NUM from other where department='"&dept&"' group by type "
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.Open sql1,conn,1,3
response.Write(dept&": ")
do while not rs1.eof
response.Write(rs1("type")rs1("NUM")&"台 ")
rs1.movenext
loop
rs1.close
response.Write("
")
next