Changes between Version 13 and Version 14 of AdvancedReports


Ignore:
Timestamp:
12/28/21 16:30:59 (2 years ago)
Author:
193181
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v13 v14  
    8080
    8181
    82 == Прикажување на бројот на филмови за секој жанр во секоја година, сортирани според бројот на филмови.
     82== Прикажување на жанрот кој бил најпопуларен според бројот на дискусии и реплики поврзани за филмови од тој жанр врз основа на дискусии и реплики кои биле поставени во претходните 2 недели.
    8383{{{
    84  select g.genre_type, extract(year from m.airing_date), count(m.movie_id) as movie_count from genres as g
    85  join movie_genres as mg on mg.genre_id = g.genre_id
    86  join movies as m on m.movie_id = mg.movie_id
    87  group by g.genre_type, extract(year from m.airing_date)
    88  order by movie_count desc
     84 select g.genre_type,
     85        count(distinct d) + count(distinct r) as discussions_replies_count
     86 from genres g
     87        join movie_genres mg on mg.genre_id = g.genre_id
     88        join movies m on m.movie_id = mg.movie_id
     89        join discussions d on d.movie_id = m.movie_id and d.date between current_date - interval '14 days' and current_date
     90        left join replies r on r.discussion_id = d.discussion_id and r.date between current_date - interval '14 days' and current_date
     91 group by g.genre_id
     92 order by count(distinct d) + count(distinct r) desc
     93 limit 1
    8994}}}
    9095