用PreparedStatement比用Statement效率要高一点!

解决方案 »

  1.   

    why not creat a view for them?
    use the Key word union
      

  2.   

    how to do that ??
    please tell me in detail..
    Thanks in advance~
      

  3.   

    同意楼上的,直接先用Union联合查询
    再插入,这样还可以过滤掉重复的数据

    insert into students (id,name) (select id, name from ?  where scord > 90 union select id, name from ?  where scord > 90 union select id, name from ?  where scord > 90);
      

  4.   

    就是先创建一个视图阿
    create view v_name as (select id, name from ?  where scord > 90 union select id, name from ?  where scord > 90 union select id, name from ?  where scord > 90);then 
    再操作
    insert into students (id,name) select id, name from  v_name
      

  5.   

    这个系统里面每周的数据可能有上百万条,是每周存一个表.  
    至于用union, 有可能要查上百的表,每个表中都要查出近10个属性,这样写是不是太长了啊???