Changes between Version 16 and Version 17 of AdvancedReports


Ignore:
Timestamp:
01/22/22 10:06:39 (3 years ago)
Author:
196021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v16 v17  
    143143
    144144
    145 ==
     145== Извештај за секоја сала,за секоја година со најмногу одржани филмски проекции и вкупен број на резервации за таа сала
    146146
     147{{{#!sql
     148select distinct a.auditorium_name , q4.god as godina,a.auditorium_capacity,vkupna_brojka.vkupno,q4.broj_odrzani_filmovi as broj_odrzani_filmovi
     149 from
     150 (
     151      select * from
     152      (
     153          select q1.godina as god , max(q1.broj_odrzani_filmovi) as maksimum from
     154          (
     155             select extract(year from r.reservation_date)as godina ,r.reservation_id as rez ,count(r.projection_id) as broj_odrzani_filmovi
     156             from reservation as r
     157             join seat as s2 on r.seat_id=s2.seat_id
     158             join auditorium as a2 on s2.auditorium_id=a2.auditorium_id
     159             join movieprojection as mp1 on r.projection_id=mp1.projection_id
     160             group by 1,2
     161          )q1
     162          group by godina
     163       
     164      )q2
     165      join
     166      (
     167      select extract (year from r.reservation_date)as godina , r.reservation_id as rez,count(r.projection_id) as broj_odrzani_filmovi
     168      from reservation as r
     169             join seat as s3 on r.seat_id=s3.seat_id
     170             join auditorium as a3 on s3.auditorium_id=a3.auditorium_id
     171             join movieprojection as mp2 on r.projection_id=mp2.projection_id
     172             group by 1,2
     173      )q3
     174       on q2.god=q3.godina and q2.maksimum=q3.broj_odrzani_filmovi
     175 
     176 ) q4
    147177
     178 join( select distinct r3.reservation_id, count(r3.projection_id) as vkupno
     179         from reservation as r3
     180          join movieprojection as mp5 on r3.projection_id=mp5.projection_id
     181          join movie as m4 on mp5.movie_id=m4.movie_id
     182          group by 1
     183 )as vkupna_brojka on vkupna_brojka.vkupno is not null
    148184
    149 ==
     185 join auditorium as a on a.auditorium_id=q4.rez
     186 order by godina desc
     187}}}
     188'''//Преку овој извештај вработените може да проверат која
     189сала е најмногу оптеретена и да направат распределба на проекциите во однос на капацитетот на седишта што го нуди салата//'''