try{
stmt=con.createStatement();
stmt.executeQuery("insert into shanghai(表名) select * from hisallstainfo(表名) as j where select j.mmsi not in (select mmsi from shanghai) and destination='SHANGHAI'or destination='SHANG HAI'");
}catch(SQLException e) {
}
现在想这样做,把SHANGHAI,SHANG HAI,shanghai,shang hai...等很多上海的情况作为一个数组S[],然后用s[i]去做“destination”的查询的参数。怎么做?另外我还想把表一中的name,mmsi,type等列和表二中的mmsi,speed等列放入一个新表格中,也用上面的java程序,怎么做?
stmt=con.createStatement();
stmt.executeQuery("insert into shanghai(表名) select * from hisallstainfo(表名) as j where select j.mmsi not in (select mmsi from shanghai) and destination='SHANGHAI'or destination='SHANG HAI'");
}catch(SQLException e) {
}
现在想这样做,把SHANGHAI,SHANG HAI,shanghai,shang hai...等很多上海的情况作为一个数组S[],然后用s[i]去做“destination”的查询的参数。怎么做?另外我还想把表一中的name,mmsi,type等列和表二中的mmsi,speed等列放入一个新表格中,也用上面的java程序,怎么做?
upper(replace(destination,' ','')) = 'SHANGHIA’
问题2.用连接就行了
select a.name,a.mmsi.a.type,b.mmsi,b.speed from table a,table b where a.xx = b.xx and .....