Changes between Version 2 and Version 3 of AdvancedReports


Ignore:
Timestamp:
12/23/22 13:10:41 (23 months ago)
Author:
181213
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v2 v3  
    22
    33- Ресторан со најмногу нарачки за последниот Х период?
     4{{{#!sql
     5SELECT q1.restoran_ime
     6FROM(
     7SELECT r.restoran_ime, COUNT(n.naracka_id) as naracki
     8FROM restoran as r
     9JOIN meni as m on r.restoran_id=m.restoran_id
     10JOIN obrok as o on m.meni_id=o.meni_id
     11JOIN se_sostoi_od as sso on o.obrok_id=sso.obrok_id
     12JOIN naracka as n on sso.naracka_id=n.naracka_id
     13GROUP BY r.restoran_ime) q1
     14WHERE q1.naracki=(SELECT MAX(naracki)FROM (
     15SELECT r.restoran_ime, COUNT(n.naracka_id) as naracki
     16FROM restoran as r
     17JOIN meni as m on r.restoran_id=m.restoran_id
     18JOIN obrok as o on m.meni_id=o.meni_id
     19JOIN se_sostoi_od as sso on o.obrok_id=sso.obrok_id
     20JOIN naracka as n on sso.naracka_id=n.naracka_id
     21GROUP BY r.restoran_ime) q1
     22)
     23}}}
    424- Најголем профит?
    525- Најнарачан производ по ресторан?