Changes between Version 4 and Version 5 of Advanced database reports (SQL and Stored procedures)


Ignore:
Timestamp:
12/21/22 22:25:35 (2 years ago)
Author:
201101
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Advanced database reports (SQL and Stored procedures)

    v4 v5  
    110110group by 1,2
    111111}}}
     112
     113== Одржана активност за која што има најголема заинтересираност во последната година
     114
     115
     116{{{#!sql
     117select a.activity_type as aktivnost,
     118       sum(a.number_of_interested_guests) as broj_na_zainteresirani_gosti
     119from activities a 
     120join reservation_for_activity rfa
     121on a.activity_id  = rfa.activity_id
     122join reservation r 
     123on r.reservation_id = rfa.reservation_id
     124where r.start_date  between  now() - interval '1 year' and now()
     125group by a.activity_type
     126order by count(a.number_of_interested_guests) desc
     127limit 1;
     128}}}