.create view a1 as
select *
from katstroy, planvar, planvalue planvalue1, planvalue planvalue2, katvarpl
where ((
PlanNrec == planvar.cplan and
! '0001000000000047h' == plstroy.nrec and
planvar.nrec == spplan.cplanvar(noindex) and
word(2101) == spplan.wtable and
word(0) == spplan.wkau and
spplan.cobject == katstroy.nrec and
word(1) == planvalue1.imode and
spplan.nrec == planvalue1.crec and
comp(0) == planvalue1.cperiod(noindex) and
word(0) == planvalue1.iregister and
word(1) == planvalue1.iprice and
word(1) == planvalue2.imode and
spplan.nrec == planvalue2.crec and
comp(0) == planvalue2.cperiod(noindex) and
word(1) == planvalue2.iregister and
word(0) == planvalue2.iprice and
planvar.cname == katvarpl.nrec
));
.create view a1 as
select
*
from
katstroy
, planvar
, planvalue planvalue1 // плановые паказатели
, planvalue planvalue2 // фактические показатели
, katvarpl
where
((
PlanNrec == planvar.cplan
and planvar.nrec == spplan.cplanvar(noindex)
and word(2101) == spplan.wtable
and word(0) == spplan.wkau
and spplan.cobject == katstroy.nrec
and word(1) == planvalue1.imode
and spplan.nrec == planvalue1.crec
and comp(0) == planvalue1.cperiod(noindex)
and word(0) == planvalue1.iregister
and word(1) == planvalue1.iprice
and word(1) == planvalue2.imode
and spplan.nrec == planvalue2.crec
and comp(0) == planvalue2.cperiod(noindex)
and word(1) == planvalue2.iregister
and word(0) == planvalue2.iprice
and planvar.cname == katvarpl.nrec
));
так меньше рябит в глазах и намного удобнее анализировать и Вам и сторонним людям - рекомендую!