日期:2014-05-16 浏览次数:20847 次
---mysql不支持者中语法的 ---创建表 create table temptest (id int not null auto_increment, .... primary key(id)) ---插入表 inert into tmptest select * from table;
------解决方案--------------------
create table c as
select a.a,ifnull(a.b,b.e),ifnull(a.c,b.f)
from a inner join b on a.a=b.d
------解决方案--------------------
create table temptest as select * from
(select * from test2 as b left join kdpumc0614 as a on (b.cname = a.cname or a.`检验项目别名` like concat('%',b.cname,'%') or a.`正式名称` like concat('%',b.cname,'%') or a.`检验项目英文名称` = b.ename or a.`检验项目英文缩写` = b.testalias) and a.sampletype = b.sampletype
union
select * from test2 as b right join kdpumc0614 as a on (b.cname = a.cname or a.`检验项目别名` like concat('%',b.cname,'%') or a.`正式名称` like concat('%',b.cname,'%') or a.`检验项目英文名称` = b.ename or a.`检验项目英文缩写` = b.testalias) and a.sampletype = b.sampletype
) t