Changes between Version 17 and Version 18 of AdvancedReports


Ignore:
Timestamp:
01/22/22 10:08:57 (3 years ago)
Author:
196021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v17 v18  
    149149 from
    150150 (
    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
     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 ) as q1
     162    group by godina
    163163       
    164       )q2
     164 ) as q2
    165165      join
    166       (
     166 (
    167167      select extract (year from r.reservation_date)as godina , r.reservation_id as rez,count(r.projection_id) as broj_odrzani_filmovi
    168168      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
     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 )as q3
     174  on q2.god=q3.godina and q2.maksimum=q3.broj_odrzani_filmovi
    175175 
    176  ) q4
     176 )as q4
    177177
    178178 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
     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
    183183 )as vkupna_brojka on vkupna_brojka.vkupno is not null
    184184