Changes between Version 21 and Version 22 of AdvancedReports


Ignore:
Timestamp:
12/23/22 20:23:42 (2 years ago)
Author:
191285
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v21 v22  
    124124{{{#!div style="font-size: 90%"
    125125  {{{#!sql
    126 select p.ime as predmet, count(zz.id_ucenik) as broj_na_zainteresirani_ucenici
    127 from predmeti p
    128 join zainteresiran_za zz
    129 on zz.id_predmet = p.id_predmet
    130 join ucenici u
    131 on u.id_ucenik = zz.id_ucenik
    132 where zz.datum between current_date - interval '100 days' and current_date
    133 group by p.ime
    134 order by count(zz.id_ucenik) desc
    135 limit 1;
     126select e2."name", q4.max_broj_zainteresirani
     127from
     128((select e.id_event, count(u.id_user) as broj_na_zainteresirani_kupuvaci
     129from ticket t 
     130join events e
     131on t.id_event  = e.id_event
     132join users u
     133on t.id_user_customer =u.id_user
     134join cart c on c.id_user_customer =t.id_user_customer
     135where e."date" between current_date - interval '100 days' and current_date
     136group by e.id_event ) q1
     137
     138join
     139
     140(
     141select max(q2.broj_na_zainteresirani_kupuvaci) as max_broj_zainteresirani
     142from (
     143select e.id_event, count(u.id_user) as broj_na_zainteresirani_kupuvaci
     144from ticket t 
     145join events e
     146on t.id_event  = e.id_event
     147join users u
     148on t.id_user_customer =u.id_user
     149join cart c on c.id_user_customer =t.id_user_customer
     150where e."date" between current_date - interval '100 days' and current_date
     151group by e.id_event
     152) q2
     153) q3 on q1.broj_na_zainteresirani_kupuvaci=q3.max_broj_zainteresirani)
     154as q4
     155join
     156events e2
     157on q4.id_event=e2.id_event
     158
    136159  }}}
    137160}}}