你查询的的条件是什么??select SubjectID from tablename where ?
选出来之后,以这种方式传入参数
<a href="/allnews.jsp?SubjectID=<%=sqlrst.getInt("SubjectID")%>"><%=sqlrst.getString("SubjectDescription")%></a></b></font></td>
sqlrst 为你在表b中查到的结果集。

解决方案 »

  1.   

    sql问题,你要使用联合查询:
    select A.SubjectID, B.SubjectDescription from A,B where B.ID=A.SubjectID and 其他查询条件...上面的sql语句示范了一个大意,语法可能不对,你可以参考sql教程或者到数据库组问问。
      

  2.   

    用联合查询,sql语句大致如下:
    select A.SubjectID,B.SubjectDescription from A,B where A.SubjectID=B.ID and ...我默认用表A到B的外键是A.SubjectID->B.ID具体可以参看sql入门书籍后者到数据库组问问hopt it helps