Changes between Version 9 and Version 10 of AdvancedReports


Ignore:
Timestamp:
01/05/23 10:52:40 (23 months ago)
Author:
201094
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v9 v10  
    151151=== Извештај за секое кино, кој филм има направено најмногу профит во последните 3 месеци ===
    152152{{{#!sql
    153 select c.id_cinema,c.name,
    154 max(sum_cena.sum1) as m
     153select c3.id_cinema,cpf3.id_film from cinemas c3
     154join cinema_plays_film cpf3 on cpf3.id_cinema=c3.id_cinema
     155join (
     156select c.id_cinema as id1,max(sum_cena.sum1) as sumMaks
    155157from cinemas c
    156158join cinema_plays_film cpf on cpf.id_cinema=c.id_cinema
     
    166168where t1.date_reserved between now()-interval'3 months' and now()
    167169group by c2.id_cinema,f2.id_film
    168 )
    169 as sum_cena on sum_cena.id=c.id_cinema
     170) as sum_cena on sum_cena.id=c.id_cinema
    170171group by c.id_cinema
    171 order by c.id_cinema
     172) as maks on maks.id1=c3.id_cinema
     173join (
     174select distinct(c2.id_cinema) as id,f2.id_film as film,sum(t1.price) as sum2 from tickets t1
     175join projections p2 on p2.id_projection=t1.id_projection
     176join films f2 on f2.id_film = p2.id_film
     177join cinema_plays_film cpf2 on cpf2.id_film=f2.id_film
     178join cinemas c2 on c2.id_cinema=cpf2.id_cinema
     179where t1.date_reserved between now()-interval'3 months' and now()
     180group by c2.id_cinema,f2.id_film
     181
     182) as counts on counts.id=c3.id_cinema and counts.film=cpf3.id_film
     183where counts.sum2=maks.sumMaks
     184group by c3.id_cinema,cpf3.id_film
     185order by c3.id_cinema
     186
    172187}}}
    173188=== Извештај за секој клиент, за секое кино, колку карти има купено во секое кино, колку пари има потрошено во секое кино, и колку кодови за попуст имаат искористено во секое кино ===