Changes between Version 9 and Version 10 of AdvancedReports
- Timestamp:
- 01/26/23 15:30:52 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v9 v10 93 93 94 94 select k.ime , 95 coalesce(prv.zbir_1,0) as prv_k avrtal, coalesce(vtor.zbir_2,0) as vtor_kvartal,95 coalesce(prv.zbir_1,0) as prv_kvartal, coalesce(vtor.zbir_2,0) as vtor_kvartal, 96 96 coalesce(tret.zbir_3,0) as tret_kvartal, coalesce(cetvrt.zbir_4,0) as cetvrt_kvartal 97 97 from kompanija k … … 101 101 join naracki as n on n.id_naracka =pedon.id_parce 102 102 left join ( 103 select k.ime ,p.ime_proizvod , p.kolicinaas zbir_1103 select k.ime ,p.ime_proizvod , count(pedon.id_parce) as zbir_1 104 104 from kompanija k 105 105 join proizvodi p on p.ime = k.ime 106 106 join parce as par on par.id_proizvod =p.id_proizvod 107 107 join parce_e_del_od_naracki pedon on pedon.id_parce =par.id_parce 108 join naracki as n on n.id_naracka =pedon.id_parce and n.data_na_naracka between to_date(concat('01-01-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('31-03-',extract(year from now())),'dd-mm-yyyy') 108 join naracki as n on n.id_naracka =pedon.id_naracka and n.data_na_naracka between to_date(concat('01-01-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('31-03-',extract(year from now())),'dd-mm-yyyy') 109 group by k.ime,p.ime_proizvod 109 110 ) as prv on k.ime = prv.ime 110 111 left join ( 111 select k.ime ,p.ime_proizvod , p.kolicinaas zbir_2112 select k.ime ,p.ime_proizvod ,count(pedon.id_parce) as zbir_2 112 113 from kompanija k 113 114 join proizvodi p on p.ime = k.ime 114 115 join parce as par on par.id_proizvod =p.id_proizvod 115 116 join parce_e_del_od_naracki pedon on pedon.id_parce =par.id_parce 116 join naracki as n on n.id_naracka =pedon.id_parce and n.data_na_naracka between to_date(concat('01-04-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('30-06-',extract(year from now())),'dd-mm-yyyy') 117 join naracki as n on n.id_naracka =pedon.id_naracka and n.data_na_naracka between to_date(concat('01-04-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('30-06-',extract(year from now())),'dd-mm-yyyy') 118 group by k.ime,p.ime_proizvod 117 119 ) as vtor on k.ime = vtor.ime 118 120 left join ( 119 select k.ime ,p.ime_proizvod , p.kolicinaas zbir_3121 select k.ime ,p.ime_proizvod , count(pedon.id_parce) as zbir_3 120 122 from kompanija k 121 123 join proizvodi p on p.ime = k.ime 122 124 join parce as par on par.id_proizvod =p.id_proizvod 123 125 join parce_e_del_od_naracki pedon on pedon.id_parce =par.id_parce 124 join naracki as n on n.id_naracka =pedon.id_parce and n.data_na_naracka between to_date(concat('01-07-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('30-09-',extract(year from now())),'dd-mm-yyyy') 126 join naracki as n on n.id_naracka =pedon.id_naracka and n.data_na_naracka between to_date(concat('01-07-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('30-09-',extract(year from now())),'dd-mm-yyyy') 127 group by k.ime,p.ime_proizvod 125 128 ) as tret on k.ime=tret.ime 126 129 left join ( 127 select k.ime ,p.ime_proizvod, p.kolicinaas zbir_4130 select k.ime ,p.ime_proizvod, count(pedon.id_parce) as zbir_4 128 131 from kompanija k 129 132 join proizvodi p on p.ime = k.ime 130 133 join parce as par on par.id_proizvod =p.id_proizvod 131 134 join parce_e_del_od_naracki pedon on pedon.id_parce =par.id_parce 132 join naracki as n on n.id_naracka =pedon.id_parce and n.data_na_naracka between to_date(concat('01-10-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('31-12-',extract(year from now())),'dd-mm-yyyy') 135 join naracki as n on n.id_naracka =pedon.id_naracka and n.data_na_naracka between to_date(concat('01-10-',extract(year from now())),'dd-mm-yyyy') and to_date(concat('31-12-',extract(year from now())),'dd-mm-yyyy') 136 group by k.ime,p.ime_proizvod 133 137 134 138 ) as cetvrt on k.ime=cetvrt.ime … … 136 140 137 141 138 139 140 141 142 }}}