Форум: "Базы";
Текущий архив: 2002.03.21;
Скачать: [xml.tar.bz2];
Внизсвязывание таблиц Найти похожие ветки
← →
xcb (2002-02-20 15:37) [5]select a.id_shet, ss.name, a.p_sum , a.r_sum, a.p_sum - a.r_sum ost_sum
from
(select s.id_shet,
nvl(sum (p.summ), 0) p_sum,
nvl(sum (r.summ), 0) r_sum
from shet s,
(select id_shet, sum(summ) from (select id_shet, summ
from prixod where docdate between :begdat and :enddat)) p,
(select id_shet, sum(summ) from (select id_shet, summ
from rashod where docdate between :begdat and :enddat)) r
where s.id_shet = p.id_shet (+)
and s.id_shet = r.id_shet (+)
group by s.id_shet) a, shet ss
where a.id_shet = ss.id_shet
где :begdat и :enddat переменные соотв начало и конец периода...
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.03.21;
Скачать: [xml.tar.bz2];
Память: 0.43 MB
Время: 0.113 c