我要实现的结果是:
我要查询表TestDataCNR和表TestDataTransmission中的数据,这两个表都有一个相同的字段SerialNumber,如果要实现这样的结果(也就是说以SerialNumber为搜索条件)
我要查询表TestDataCNR和表TestDataTransmission中的数据,这两个表都有一个相同的字段SerialNumber,如果要实现这样的结果(也就是说以SerialNumber为搜索条件)
SELECT * from TestDataCNR SerialNumber, TestDataTransmission SerialNumber WHERE TestDataCNR.SerialNumber=TestDataTransmission.SerialNumber
出错提示
javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]在 FROM 子句中多次指定了相关名称 'SerialNumber'。
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Td_005fjsp_jsp._jspService(Td_005fjsp_jsp.java:145)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
错误提示::
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 4.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Td_005fjsp_jsp._jspService(Td_005fjsp_jsp.java:145)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 4.
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)
com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)
Photon.tr.TdBean.getTd_CNRByTd_Transmission(TdBean.java:46)
org.apache.jsp.Td_005fjsp_jsp._jspService(Td_005fjsp_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
* 改成你要显示的列名,并且指定表SELECT TestDataCNR.a, TestDataCNR.b, ...... from TestDataCNR ,TestDataTransmission WHERE TestDataCNR.SerialNumber=TestDataTransmission.SerialNumber