wii模拟器圣恩传说:select语句怎么查询两个结构相同的表啊??

来源:百度文库 编辑:高考问答 时间:2024/03/28 22:42:30
<%
Class.forName
("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:product");
String productid=new String(request.getParameter("id").getBytes("8859_1"));
String selsql="select * from ////////// where productid='"+productid+"'";
Statement stmt=con.createStatement();
ResultSet rest=stmt.executeQuery(selsql);
if (rest.next())
{
%>

/////位置我想放2个表 怎么写啊!!!!!!!!!!!

select * from tableA where productid='"+productid+"'
union
select * from tableB where productid='"+productid+"'

select * from tableA a,tableB b where a.productid='"+productid+"' or b.productid='"+productid+"'