why not creat a view for them? use the Key word union
how to do that ?? please tell me in detail.. Thanks in advance~
同意楼上的,直接先用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);
就是先创建一个视图阿 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
use the Key word union
please tell me in detail..
Thanks in advance~
再插入,这样还可以过滤掉重复的数据
如
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);
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
至于用union, 有可能要查上百的表,每个表中都要查出近10个属性,这样写是不是太长了啊???