Извиняюсь за поздний ответЮ возможно я вот это в скрипт не засунул
Код:
create or replace view supermag.mvcardclassextrachage as
select t.id,t.tree,t.pricetype,t.pricename,
nvl(m6.extracharge,nvl(m5.extracharge,nvl(m4.extracharge,nvl(m3.extracharge,nvl(m2.extracharge,nvl(m1.extracharge,m.extracharge)))))) extracharge
from
(
select d.id,
d.tree,
p.id pricetype,
p.name pricename,
0 id_parent,
d1.id id_parent1,
d2.id id_parent2,
d3.id id_parent3,
d4.id id_parent4,
d5.id id_parent5,
d6.id id_parent6
from
SUPERMAG.Svcardtreesplit D,
SUPERMAG.Sacardclass D1,
SUPERMAG.Sacardclass D2,
SUPERMAG.Sacardclass D3,
SUPERMAG.Sacardclass D4,
SUPERMAG.Sacardclass D5,
SUPERMAG.Sacardclass D6,
SUPERMAG.SMPRICETYPES P
where
d1.tree(+)=nvl(d.Item1,'#') and
d2.tree(+)=nvl(d.Item1,'#')||nvl(d.Item2,'#') and
d3.tree(+)=nvl(d.Item1,'#')||nvl(d.Item2,'#')||nvl(d.Item3,'#') and
d4.tree(+)=nvl(d.Item1,'#')||nvl(d.Item2,'#')||nvl(d.Item3,'#')||nvl(d.Item4,'#') and
d5.tree(+)=nvl(d.Item1,'#')||nvl(d.Item2,'#')||nvl(d.Item3,'#')||nvl(d.Item4,'#')||nvl(d.Item5,'#') and
d6.tree(+)=nvl(d.Item1,'#')||nvl(d.Item2,'#')||nvl(d.Item3,'#')||nvl(d.Item4,'#')||nvl(d.Item5,'#')||nvl(d.Item6,'#')
) T,
SUPERMAG.SMMARKUPCLASS M6,
SUPERMAG.SMMARKUPCLASS M5,
SUPERMAG.SMMARKUPCLASS M4,
SUPERMAG.SMMARKUPCLASS M3,
SUPERMAG.SMMARKUPCLASS M2,
SUPERMAG.SMMARKUPCLASS M1,
SUPERMAG.SMMARKUPCLASS M
where
(m6.pricetype(+)=T.pricetype and m6.idclass(+)=T.id_parent6) and
(m5.pricetype(+)=T.pricetype and m5.idclass(+)=T.id_parent5) and
(m4.pricetype(+)=T.pricetype and m4.idclass(+)=T.id_parent4) and
(m3.pricetype(+)=T.pricetype and m3.idclass(+)=T.id_parent3) and
(m2.pricetype(+)=T.pricetype and m2.idclass(+)=T.id_parent2) and
(m1.pricetype(+)=T.pricetype and m1.idclass(+)=T.id_parent1) and
(m.pricetype=T.pricetype and m.idclass=T.id_parent) and not m.extracharge is null
попорбуйте создать эту вьюшку..заработают наценки?