Changes between Version 6 and Version 7 of AdvancedReports
- Timestamp:
- 01/04/23 10:10:08 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v6 v7 7 7 {{{ 8 8 select p.ime , 9 9 10 count(nsp) as broj_na_naracki_vo_koi_e_prisuten_produktot, 11 10 12 sum(nsp.kolicina) as kolicina_prodadeno_od_produktot, 11 (select avg(n4.vkupno_suma) from naracka n4 join naracka_sodrzi_produkt nsp4 on n4.id_naracka = nsp4.id_naracka 12 where n4.id_naracka =nsp4.id_naracka and p.id_produkt = nsp4.id_produkt and n4.datum between now() - interval '3months' and now()) 13 14 (select avg(n4.vkupno_suma) from naracka n4 15 join naracka_sodrzi_produkt nsp4 on n4.id_naracka = nsp4.id_naracka 16 where n4.id_naracka =nsp4.id_naracka and p.id_produkt = nsp4.id_produkt and n4.datum between now() - interval '3months' 17 and now()) 13 18 as prosecna_suma_na_naracka_vo_koja_se_sodrzi_produktot, 19 14 20 (select count(n2) from naracka n2 join naracka_sodrzi_produkt nsp2 on n2.id_naracka = nsp2.id_naracka 15 where nsp2.id_produkt = p.id_produkt and n2.adresa like '/' and n2.datum between now() - interval '3months' and now()) 21 where nsp2.id_produkt = p.id_produkt and n2.adresa like '/' 22 and n2.datum between now() - interval '3months' and now()) 16 23 as broj_na_naracki_na_produktot_koi_korisnikot_sam_ke_gi_podigne, 17 (select sum(nsp2.kolicina) from naracka n2 join naracka_sodrzi_produkt nsp2 on n2.id_naracka = nsp2.id_naracka 18 where nsp2.id_produkt = p.id_produkt and n2.adresa like '/' and n2.datum between now() - interval '3months' and now()) 24 25 (select sum(nsp2.kolicina) from naracka n2 26 join naracka_sodrzi_produkt nsp2 on n2.id_naracka = nsp2.id_naracka 27 where nsp2.id_produkt = p.id_produkt and n2.adresa like '/' 28 and n2.datum between now() - interval '3months' and now()) 19 29 as kolicina_prodadena_na_produktot_bez_dostava, 20 (select count(n3) from naracka n3 join naracka_sodrzi_produkt nsp3 on n3.id_naracka = nsp3.id_naracka 30 31 (select count(n3) from naracka n3 32 join naracka_sodrzi_produkt nsp3 on n3.id_naracka = nsp3.id_naracka 21 33 where nsp3.id_produkt = p.id_produkt and n3.adresa not like '/' and n3.datum between now() - interval '3months' and now()) 22 34 as broj_na_naracki_na_produktot_koi_ke_bidat_dostaveni_na_korisnikot, 23 (select sum(nsp3.kolicina) from naracka n3 join naracka_sodrzi_produkt nsp3 on n3.id_naracka = nsp3.id_naracka 35 36 (select sum(nsp3.kolicina) from naracka n3 37 join naracka_sodrzi_produkt nsp3 on n3.id_naracka = nsp3.id_naracka 24 38 where nsp3.id_produkt = p.id_produkt and n3.adresa not like '/' and n3.datum between now() - interval '3months' and now()) 25 39 as kolicina_prodadena_na_produktot_preku_dostava 40 26 41 from produkt p 27 42 join naracka_sodrzi_produkt nsp on p.id_produkt = nsp.id_produkt … … 39 54 {{{ 40 55 select k.ime_prezime, 56 41 57 (select count(n) from naracka n 42 58 where n.id_korisnik = k.id_korisnik) 43 59 as vkupno_naracki, 60 44 61 (select avg(vkupno_suma) from naracka ) 45 62 as prosecna_suma_na_naracka_za_site_kupuvaci, 63 46 64 (select sum(n3.vkupno_suma) from naracka n3 47 65 where k.id_korisnik = n3.id_korisnik) 48 66 as vkupno_suma_od_site_naracki_na_kupuvacot, 67 49 68 (select count(n2) from naracka n2 50 69 where k.id_korisnik = n2.id_korisnik … … 52 71 and n2.vkupno_suma > (select avg(vkupno_suma) from naracka) ) 53 72 as vkupno_naracki_nad_prosek_na_korisnikot, 73 54 74 (select sum(n4.vkupno_suma) from naracka n4 55 75 where k.id_korisnik = n4.id_korisnik … … 57 77 and n4.vkupno_suma > (select avg(vkupno_suma) from naracka) ) 58 78 as vkupno_suma_na_naracki_nad_prosek_za_korisnikot 79 59 80 from korisnik k 60 81 join kupuvac k2 on k.id_korisnik = k2.id_korisnik