Changes between Version 10 and Version 11 of AdvancedReports
- Timestamp:
- 01/12/22 01:58:32 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v10 v11 11 11 from 12 12 ( 13 select p.id_predmet as predmet, n.id_nastavnik ,count(u.id_ucenik) as ucenici13 select p.id_predmet as predmet, n.id_nastavnik, count(u.id_ucenik) as ucenici 14 14 from predmeti p 15 15 join predava_predmet pp on p.id_predmet = pp.id_predmet … … 21 21 as broj_ucenici 22 22 group by broj_ucenici.predmet 23 ) asq123 ) q1 24 24 25 25 join ( 26 select p.id_predmet as predmet2 ,n.id_nastavnik ,count(u.id_ucenik) as ucenici226 select p.id_predmet as predmet2, n.id_nastavnik, count(u.id_ucenik) as ucenici2 27 27 from predmeti p 28 28 join predava_predmet pp on p.id_predmet = pp.id_predmet … … 30 30 join predava_na pn on n.id_nastavnik = pn.id_nastavnik 31 31 join ucenici u on u.id_ucenik =pn.id_ucenik 32 group by p.id_predmet 33 ) asq232 group by p.id_predmet, n.id_nastavnik 33 ) q2 34 34 on q2.predmet2 = q1.predmet and q2.ucenici2 = q1.ucenici 35 35 36 ) asq336 ) q3 37 37 join nastavnici n on n.id_nastavnik = q3.id_nastavnik 38 38 join predmeti p on p.id_predmet = q3.predmet 39 }}} 40 41 == Приказ на предмети со најголем број одржани часови на годишно ниво == 42 {{{#!sql 43 select q4.god as godina, p.ime as predmet, q4.broj_casovi as broj_casovi 44 from 45 ( 46 47 select * from 48 ( 49 select q1.godina as god, max(q1.broj_casovi) as maksimum from 50 ( 51 select extract (year from c.vreme_pocetok) as godina, p.id_predmet as predmet, count(c.id_cas) broj_casovi 52 from predmeti p 53 join casovi c on c.id_predmet = p.id_predmet 54 group by godina,predmet 55 ) q1 56 group by godina 57 ) q2 58 join 59 ( 60 select extract (year from c.vreme_pocetok) as godina, p.id_predmet as predmet, count(c.id_cas) broj_casovi 61 from predmeti p 62 join casovi c on c.id_predmet = p.id_predmet 63 group by godina,predmet 64 ) q3 65 on q2.god=q3.godina and q2.maksimum=q3.broj_casovi 66 67 ) q4 68 join predmeti p on p.id_predmet = q4.predmet 69 order by godina desc; 39 70 }}} 40 71