select a.id, a.name, b.type, d.width
from a
inner join b on a.id = b.id
right join c on b.type = c.type
inner join d on a.id = d.id
and a.width = d.width
and b.type=d.type
and a.value is not null;
from a
inner join b on a.id = b.id
right join c on b.type = c.type
inner join d on a.id = d.id
and a.width = d.width
and b.type=d.type
and a.value is not null;
select a.id ,a.name,b.type,d.width from( (select * from a where a.value is not null)a
left jion ((select * from d left join b on b.type=d.type )d on a.id=d.id and a.width=d.width)b on b.id=a.id)a
left join c on a.type=c.type(+)
给看看,再修改、如果能执行的话,给个结果,如何,如何优化?