Changes between Version 5 and Version 6 of AdvancedReports


Ignore:
Timestamp:
12/28/21 13:00:37 (3 years ago)
Author:
193113
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v5 v6  
    4848== Предложување на филмови на корисник врз база на корисниците со кои стапил во интеракција
    4949{{{
    50 
    51  select distinct m.title
    52  from replies r
    53  join discussions d on r.discussion_id = d.discussion_id
    54  join replies r2 on r2.discussion_id  = d.discussion_id  and r2.user_id  != 1
    55  join users u  on u.user_id  = r2.user_id
    56  join movie_likes ml on ml.user_id = u.user_id
    57  join movies m  on m.movie_id = ml.movie_id
    58  where  r.user_id = 1;
     50select title from(
     51         select  m.title, sum(mv.stars_rated) as total
     52         from replies r
     53         join discussions d on r.discussion_id = d.discussion_id
     54         join replies r2 on r2.discussion_id  = d.discussion_id  and r2.user_id  != 1
     55         join users u  on u.user_id  = r2.user_id
     56         join movie_rates mv on mv.user_id = u.user_id
     57         join movies m on m.movie_id  = mv.movie_id
     58         where  r.user_id = 1
     59         group by m.title
     60         order by sum(mv.stars_rated) desc
     61         limit 10
     62 ) as tabela;
    5963}}}
    6064