Changes between Version 3 and Version 4 of AdvancedReports


Ignore:
Timestamp:
01/18/22 22:49:33 (3 years ago)
Author:
193270
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v3 v4  
    55select kat.ime_kategorija,count(kat.ime_kategorija) as pozajmeni_knigi_od_kategorija
    66from pozajmica as p
     7
    78join knigi as k on p.id_na_kniga = k.id_na_kniga
    89join e_od as e on k.id_na_kniga = e.id_knigi
    910join kategorija as kat on e.id_na_kategorija = kat.id_na_kategorija
     11
    1012where p.datum_na_zemanje between now() - interval'3 weeks' and now()
    1113group by 1
     
    1820select ch.ime,ch.prezime,(count(ch.id_chovek)) as pozajmuvanja
    1921from pozajmica as p
     22
    2023join chlen as chl on p.id_chovek_prave = chl.id_chovek
    2124join chovek as ch on chl.id_chovek = ch.id_chovek
    2225join knigi as k on p.id_na_kniga = k.id_na_kniga
    2326where p.datum_na_zemanje between now() - interval'1 month' and now()
     27
    2428group by 1,2
    2529order by pozajmuvanja desc
    2630fetch first row only;
    2731}}}
     32
     33== Прикажување на возрасната група која има направено најмногу позајмици во одреден временски интервал
     34{{{
     35select count(p.id_na_pozajmica) as pozajmici
     36from pozajmica as p
     37
     38join chlen as chl on p.id_chovek_prave = chl.id_chovek
     39join chovek as ch on chl.id_chovek = ch.id_chovek
     40join knigi as k on p.id_na_kniga = k.id_na_kniga
     41
     42where age(((case when substr(embg,5,1) = '9' then '1' || substr(embg,5,3)
     43else '2' || substr(embg,5,3) end) || '-' || substr(embg,3,2) || '-' || substr(embg,1,2))::date) between interval '20 years' and interval '22 years'
     44and p.datum_na_zemanje between now() - interval'3 weeks' and now()
     45}}}