Changes between Version 3 and Version 4 of AdvancedReports
- Timestamp:
- 01/18/22 22:49:33 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v3 v4 5 5 select kat.ime_kategorija,count(kat.ime_kategorija) as pozajmeni_knigi_od_kategorija 6 6 from pozajmica as p 7 7 8 join knigi as k on p.id_na_kniga = k.id_na_kniga 8 9 join e_od as e on k.id_na_kniga = e.id_knigi 9 10 join kategorija as kat on e.id_na_kategorija = kat.id_na_kategorija 11 10 12 where p.datum_na_zemanje between now() - interval'3 weeks' and now() 11 13 group by 1 … … 18 20 select ch.ime,ch.prezime,(count(ch.id_chovek)) as pozajmuvanja 19 21 from pozajmica as p 22 20 23 join chlen as chl on p.id_chovek_prave = chl.id_chovek 21 24 join chovek as ch on chl.id_chovek = ch.id_chovek 22 25 join knigi as k on p.id_na_kniga = k.id_na_kniga 23 26 where p.datum_na_zemanje between now() - interval'1 month' and now() 27 24 28 group by 1,2 25 29 order by pozajmuvanja desc 26 30 fetch first row only; 27 31 }}} 32 33 == Прикажување на возрасната група која има направено најмногу позајмици во одреден временски интервал 34 {{{ 35 select count(p.id_na_pozajmica) as pozajmici 36 from pozajmica as p 37 38 join chlen as chl on p.id_chovek_prave = chl.id_chovek 39 join chovek as ch on chl.id_chovek = ch.id_chovek 40 join knigi as k on p.id_na_kniga = k.id_na_kniga 41 42 where age(((case when substr(embg,5,1) = '9' then '1' || substr(embg,5,3) 43 else '2' || substr(embg,5,3) end) || '-' || substr(embg,3,2) || '-' || substr(embg,1,2))::date) between interval '20 years' and interval '22 years' 44 and p.datum_na_zemanje between now() - interval'3 weeks' and now() 45 }}}