Changes between Version 7 and Version 8 of AdvancedReports


Ignore:
Timestamp:
01/05/23 06:32:23 (2 years ago)
Author:
201094
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v7 v8  
    225225group by e.id_event
    226226}}}
     227
     228=== Извештај за секој филм, колку карти се продадени и колкав профит има секој филм направено, колку различни клиенти купиле карта за филмот и колку рејтинзи има секој филм ===
     229{{{#!sql
     230select f.id_film,
     231coalesce((
     232select count(distinct t.id_ticket) from tickets t
     233left join projections p on p.id_projection=t.id_projection
     234left join films f1 on f1.id_film=p.id_film
     235where f.id_film=f1.id_film
     236),0),
     237coalesce((
     238select sum(t.price) from tickets t
     239left join projections p on p.id_projection=t.id_projection
     240left join films f1 on f1.id_film=p.id_film
     241where f.id_film=f1.id_film
     242),0),
     243coalesce((
     244select count(distinct c.id_customer) from customers c
     245left join tickets t2 on t2.id_customer=c.id_customer
     246left join projections p on p.id_projection=t2.id_projection
     247left join films f1 on f1.id_film=p.id_film
     248where f.id_film=f1.id_film
     249),0),
     250coalesce((
     251select count(crf.rating) from customer_rates_film crf
     252left join films f2 on f2.id_film=crf.id_film
     253where f2.id_film=f.id_film
     254),0)
     255from films f
     256}}}