Changes between Version 8 and Version 9 of AdvancedReports


Ignore:
Timestamp:
01/05/23 06:53:47 (23 months ago)
Author:
201094
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v8 v9  
    255255from films f
    256256}}}
     257
     258=== Извештај за секое кино, колку вработени има и колку пари треба да исплати секое кино следниов месец на неговите вработени ===
     259{{{#!sql
     260select c.id_cinema,
     261coalesce((
     262select count(distinct w.id_worker) from workers w
     263left join cinemas c1 on c1.id_cinema=w.id_cinema
     264where c1.id_cinema=c.id_cinema
     265),0),
     266coalesce((
     267select sum(s.sum) from salaries s
     268left join workers w2 on s.id_worker=w2.id_worker
     269left join cinemas c1 on c1.id_cinema=w2.id_cinema
     270where c1.id_cinema=c.id_cinema and s.date_to is null
     271),0)
     272from cinemas c
     273}}}