Changes between Version 19 and Version 20 of AdvancedReports


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

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v19 v20  
    151151}}}
    152152
    153 == Листа на артисти со број на одржани настани
     153== Артист со максимален број на одржани настани
    154154
    155155{{{#!div style="font-size: 90%"
    156156  {{{#!sql
    157 select p.ime as predmet, count(pp.id_nastavnik) broj_na_nastavnici
    158 from predmeti p
    159 join predava_predmet pp on pp.id_predmet = p.id_predmet
    160 group by p.id_predmet
    161 order by p.ime;
     157select q4."name", q4.surname, q4.max_broj_nastani
     158from
     159(
     160
     161(select u."name", u.surname, count(e.id_event) as broj_nastani
     162from artist a join users u on a.id_user =u.id_user
     163join events e on a.id_user =e.id_user_artist
     164group by  u."name", u.surname) q1
     165
     166join
     167
     168(select max(q2.broj_nastani) as max_broj_nastani
     169from (select u."name", u.surname, count(e.id_event) as broj_nastani
     170from artist a join users u on a.id_user =u.id_user
     171join events e on a.id_user =e.id_user_artist
     172group by  u."name", u.surname
     173) q2 ) q3
     174on q1.broj_nastani=q3.max_broj_nastani)
     175
     176as q4
    162177  }}}
    163178}}}